[fdo-users] Right way of creating a GML file?
Elavazhagan. M
elavazhagan.mouniandy at kcubeconsulting.com
Fri Nov 26 05:53:21 EST 2010
Hi,
Can somebody please tell me whether the following approach (in C#) is the
right way to generate a GML file?
//Select features
ISelect select =
(ISelect)connection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType
_Select);
select.SetFeatureClassName(featureClassName);
IFeatureReader featureReader = select.Execute();
//Write features
XmlWriter xmlWriter = new XmlWriter(gmlFilePath);
XmlFeatureWriter xmlFeatureWriter = new
XmlFeatureWriter(xmlWriter);
XmlFeatureSerializer.XmlSerialize(featureReader,
xmlFeatureWriter);
This creates a GML file in the following format:
<?xml version="1.0" encoding="UTF-8" ?>
<fdo:DataStore xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:gml="http://www.opengis.net/gml"
xmlns:fdo="http://fdo.osgeo.org/schemas"
xmlns:fds="http://fdo.osgeo.org/schemas/fds">
<building>
<gid>10</gid>
<AREA>2365</AREA>
<PERIMETER>3400</PERIMETER>
<the_geom>
<gml:Polygon srsName="EPSG:4326">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>1550000.000000,6425000.000000
1525000.000000,6425000.000000 1525000.000000,6450000.000000
1550000.000000,6450000.000000
1550000.000000,6425000.000000</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</the_geom>
</building>
</fdo:DataStore>
But I am unable to open the GML in QGIS as it says, "building.gml is not a
valid or recognized data source".
Thanks,
Ela.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20101126/b194923c/attachment.html
More information about the fdo-users
mailing list