[mapguide-users] Can't create layer using MySQL feature source

Stefan Dalakov s.dalakov at mapware.net
Fri Apr 10 17:29:00 EDT 2009


Manel,
I have used MapGuide Studio 2008 to create this feature source.
Perhaps Kenneth can answer if this is a bug, or there is something extra 
to be done in setting the feature source.
I have the same version of Maestro as yours.

Stefan Dalakov

Manel Gimeno wrote:
> Thanks Stefan.
>  
> I copy and paste directly your XML (changing name, password,...) in 
> Mapguide Maestro XML editor and it works fine.
>  
> But as you said the server name appears under "Database" while 
> "server" and "port" fields remain empty in Mapguide Maestro.
>  
> Using directly Mapguide Maestro the XML generated is:
>  
> <?xml version="1.0" encoding="utf-8"?>
> <FeatureSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
> xsi:noNamespaceSchemaLocation="FeatureSource-1.0.0.xsd">
>   <Provider>OSGeo.MySQL</Provider>
>   <Parameter>
>     <Name>Username</Name>
>     <Value>root</Value>
>   </Parameter>
>   <Parameter>
>     <Name>Password</Name>
>     <Value>password</Value>
>   </Parameter>
>   <Parameter>
>     <Name>Service</Name>
>     <Value>database at localhost:3306</Value>
>   </Parameter>
>   <Parameter>
>     <Name>DataStore</Name>
>     <Value />
>   </Parameter>
> </FeatureSource> 
>  
> It is quite different as your and it doesn't work. Maybe there is a 
> bug in Maestro or I need to upgrade my version, I'm using Mapguide 
> Maestro version 1.0.9.15919
>  
> Regards
> Manel Gimeno
>
>     ----- Original Message -----
>     *From:* Stefan Dalakov <mailto:s.dalakov at mapware.net>
>     *To:* MapGuide Users Mail List
>     <mailto:mapguide-users at lists.osgeo.org>
>     *Sent:* Monday, April 06, 2009 8:03 PM
>     *Subject:* Re: [mapguide-users] Can't create layer using MySQL
>     feature source
>
>     Here is the FeatureSource
>
>     I find interesting thing here.
>     When I open this FeatureSource in MG Studio I see
>     my server name appearing under "Service"
>     In Maestro the same server name appears under "Database", while
>     "server"
>     and "port" fields remain empty.
>     Do you have MG Studio ?
>     How did your data get in MySQL format ?
>     If you don't manage, mail me directly, not thru the list and I
>     will send
>     you the pwd.
>
>     Stefan Dalakov
>
>     <?xml version="1.0" encoding="utf-8"?>
>     <FeatureSource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>     xsi:noNamespaceSchemaLocation="FeatureSource-1.0.0.xsd">
>       <Provider>OSGeo.MySQL</Provider>
>       <Parameter>
>         <Name>Username</Name>
>         <Value>%MG_USERNAME%</Value>
>       </Parameter>
>       <Parameter>
>         <Name>Password</Name>
>         <Value>%MG_PASSWORD%</Value>
>       </Parameter>
>       <Parameter>
>         <Name>Service</Name>
>         <Value>mysql2.winhostingcenter.com</Value>
>       </Parameter>
>       <Parameter>
>         <Name>DataStore</Name>
>         <Value>technop_mg</Value>
>       </Parameter>
>       <SupplementalSpatialContextInfo>
>         <Name>Default</Name>
>         <CoordinateSystem>LOCAL_CS["Non-Earth (Meter)",LOCAL_DATUM["Local
>     Datum",0],UNIT["Meter",
>     1],AXIS["X",EAST],AXIS["Y",NORTH]]</CoordinateSystem>
>       </SupplementalSpatialContextInfo>
>       <ConfigurationDocument>config.xml</ConfigurationDocument>
>     </FeatureSource>
>
>
>     Manel Gimeno wrote:
>     > Thanks Stefan.
>     > 
>     > I think the main problem is in the connection to MySQL. Even
>     Mapguide
>     > Maestro says that there is no error reported I've tried to use the
>     > FeatureSource  to connect using MapAgent/Test connection and the
>     test
>     > doesn't work (it return false).
>     > 
>     > Could you send me your FeatureSource XML to try to find where the
>     > problem is?
>     > 
>     > Thanks in advance
>     > Manel Gimeno
>     > 
>     > ----- Original Message -----
>     >
>     >     *From:* Stefan Dalakov <mailto:s.dalakov at mapware.net>
>     >     *To:* MapGuide Users Mail List
>     >     <mailto:mapguide-users at lists.osgeo.org>
>     >     *Sent:* Monday, April 06, 2009 4:48 PM
>     >     *Subject:* Re: [mapguide-users] Can't create layer using MySQL
>     >     feature source
>     >
>     >     Hi Manel,
>     >     Here is a layerDefinition that works for me.
>     >     Have you specified Coordinate-System-Overrides ?
>     >
>     >     Stefan Dalakov
>     >
>     >     <?xml version="1.0" encoding="UTF-8" ?>
>     >     - <#> <LayerDefinition
>     >     xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*"
>     >     xsi:noNamespaceSchemaLocation="*LayerDefinition-1.1.0.xsd*"
>     >     version="*1.1.0*">
>     >     - <#> <VectorLayerDefinition>
>     >       <ResourceId>Library://mysql_ds.FeatureSource</ResourceId>
>     >       <FeatureName>Fdotechnop_mg:links</FeatureName>
>     >       <FeatureNameType>FeatureClass</FeatureNameType>
>     >     - <#> <PropertyMapping>
>     >       <Name>LAYER</Name>
>     >       <Value>LAYER</Value>
>     >       </PropertyMapping>
>     >     - <#> <PropertyMapping>
>     >       <Name>LENGTH</Name>
>     >       <Value>LENGTH</Value>
>     >       </PropertyMapping>
>     >       <Geometry>ogc_geom</Geometry>
>     >     - <#> <VectorScaleRange>
>     >     - <#> <PointTypeStyle>
>     >       <DisplayAsText>false</DisplayAsText>
>     >       <AllowOverpost>false</AllowOverpost>
>     >     - <#> <PointRule>
>     >       <LegendLabel />
>     >       </PointRule>
>     >       </PointTypeStyle>
>     >     - <#> <LineTypeStyle>
>     >     - <#> <LineRule>
>     >       <LegendLabel>'Main Pipe'</LegendLabel>
>     >       <Filter>"LAYER" = 'Main Pipe'</Filter>
>     >     - <#> <LineSymbolization2D>
>     >       <LineStyle>Solid</LineStyle>
>     >       <Thickness>2</Thickness>
>     >       <Color>FF000000</Color>
>     >       <Unit>Points</Unit>
>     >       <SizeContext>DeviceUnits</SizeContext>
>     >       </LineSymbolization2D>
>     >       </LineRule>
>     >     - <#> <LineRule>
>     >       <LegendLabel>'Pipeline'</LegendLabel>
>     >       <Filter>"LAYER" = 'Pipeline'</Filter>
>     >     - <#> <LineSymbolization2D>
>     >       <LineStyle>Solid</LineStyle>
>     >       <Thickness>2</Thickness>
>     >       <Color>FF000080</Color>
>     >       <Unit>Points</Unit>
>     >       <SizeContext>DeviceUnits</SizeContext>
>     >       </LineSymbolization2D>
>     >       </LineRule>
>     >     - <#> <LineRule>
>     >       <LegendLabel />
>     >     - <#> <LineSymbolization2D>
>     >       <LineStyle>Solid</LineStyle>
>     >       <Thickness>0.0</Thickness>
>     >       <Color>ff000000</Color>
>     >       <Unit>Centimeters</Unit>
>     >       <SizeContext>DeviceUnits</SizeContext>
>     >       </LineSymbolization2D>
>     >       </LineRule>
>     >       </LineTypeStyle>
>     >     - <#> <AreaTypeStyle>
>     >     - <#> <AreaRule>
>     >       <LegendLabel />
>     >     - <#> <AreaSymbolization2D>
>     >     - <#> <Fill>
>     >       <FillPattern>Solid</FillPattern>
>     >       <ForegroundColor>ffffffff</ForegroundColor>
>     >       <BackgroundColor>ff000000</BackgroundColor>
>     >       </Fill>
>     >     - <#> <Stroke>
>     >       <LineStyle>Solid</LineStyle>
>     >       <Thickness>0.0</Thickness>
>     >       <Color>ff000000</Color>
>     >       <Unit>Centimeters</Unit>
>     >       <SizeContext>DeviceUnits</SizeContext>
>     >       </Stroke>
>     >       </AreaSymbolization2D>
>     >       </AreaRule>
>     >       </AreaTypeStyle>
>     >       </VectorScaleRange>
>     >       </VectorLayerDefinition>
>     >       </LayerDefinition>
>     >
>     >
>     >     Manel Gimeno wrote:
>     >>     Hi all,
>     >>     
>     >>     I've created a MySQL FeatureSource in Mapguide 2.0 using
>     Mapguide
>     >>     Maestro 1.0.9.15910. When I click in the test connection button
>     >>     no error is reported, so it seems the connection to MySQL
>     works fine.
>     >>     
>     >>     When I try to create a FeatureLayer using the MySQL
>     FeatureSource
>     >>     previously defined the following error happens after selecting
>     >>     the FeatureSource as resource:
>     >>     
>     >>     "Failed to read schema from data source.
>     >>     The operation gave the error message: Error en el servidor
>     >>     remoto: (559) MgConnectionFailedException.:
>     >>     Cannot establish connection.
>     >>     Exception occurred in method
>     >>     MgServerDescribeSchema::ExecuteDescribeSchema() at line 173 in
>     >>     file
>     >>    
>     d:\buildforgeprojects\mapguide_open_source_v2.0\build_23.8\mgdev\server\src\services\feature\ServerDescribeSchema.cpp"
>     >>     
>     >>     Can anyone help me to solve this problem? (Maybe if you have an
>     >>     example of XML LayerDefinition using a MySQL FeatureSource...)
>     >>     
>     >>     Thanks in advance
>     >>     Manel Gimeno
>     >>    
>     ------------------------------------------------------------------------
>     >>
>     >>     _______________________________________________
>     >>     mapguide-users mailing list
>     >>     mapguide-users at lists.osgeo.org
>     <mailto:mapguide-users at lists.osgeo.org>
>     >>     http://lists.osgeo.org/mailman/listinfo/mapguide-users
>     >>      
>     >
>     >    
>     ------------------------------------------------------------------------
>     >     _______________________________________________
>     >     mapguide-users mailing list
>     >     mapguide-users at lists.osgeo.org
>     <mailto:mapguide-users at lists.osgeo.org>
>     >     http://lists.osgeo.org/mailman/listinfo/mapguide-users
>     >
>     >
>     ------------------------------------------------------------------------
>     >
>     > _______________________________________________
>     > mapguide-users mailing list
>     > mapguide-users at lists.osgeo.org
>     <mailto:mapguide-users at lists.osgeo.org>
>     > http://lists.osgeo.org/mailman/listinfo/mapguide-users
>     >  
>
>     _______________________________________________
>     mapguide-users mailing list
>     mapguide-users at lists.osgeo.org <mailto:mapguide-users at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090411/256cf4ac/attachment.html


More information about the mapguide-users mailing list