[gdal-dev] GML to Shapefile
Stefan Keller
sfkeller at gmail.com
Tue Jul 1 19:31:27 EDT 2008
Hi,
I tried to convert a GML file to Shapefile whereas the GML contains points,
linestrings and polygons (see GML snippet below).
The command goes something like this: % ogr2ogr -f "ESRI Shapefile" outdir
mydata.gml
Now, what I'm getting out is mydata.shp (+.dbf/shx) and alayer.shp
(+.dbf/shx), where mydata contains point type and alayer contains linestring
type. => Why is there an additional linestring shapefile but no polygon
shapefile?
-- Stefan
GML snippet of mydata.gml:
...
<gml:featureMember>
<osm:way fid="4304746">
<osm:id>4304746</osm:id>
<osm:timestamp>2008-03-25T21:31:01+00:00</osm:timestamp>
<osm:user>Schäuble Michele</osm:user>
<osm:geometryProperty>
<gml:polygonMember>
<gml:Polygon>
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>8.8971245,47.2066117 8.8958854,47.2065926
8.8951875,47.2061166 8.893922,47.2073953 8.8921772,47.2079074 ...
8.8971383,47.2051962 8.8962002,47.2044168 8.8955145,47.2051218
8.8966504,47.2060895 8.8971132,47.2060825 8.8971245,47.2066117
</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</gml:polygonMember>
</osm:geometryProperty>
<osm:natural>water</osm:natural>
</osm:way>
</gml:featureMember>
<gml:featureMember>
<osm:way fid="4684550">
<osm:id>4684550</osm:id>
<osm:timestamp>2008-04-28T16:55:00+01:00</osm:timestamp>
<osm:user>Schäuble Michele</osm:user>
<osm:geometryProperty>
<gml:LineString>
<gml:coordinates>8.8370022,47.2301952 8.8368472,47.2301807
8.8355139,47.2296331 8.832977,47.2291911 8.8297158,47.2285296
8.8256068,47.2278459 8.8223489,47.2273065 8.8188251,47.2267218
8.8183819,47.2267204 </gml:coordinates>
</gml:LineString>
</osm:geometryProperty>
<osm:highway>primary</osm:highway>
</osm:way>
</gml:featureMember>
....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080702/116a37ce/attachment.html
More information about the gdal-dev
mailing list