[mapserver-users] wfs data conversion with ogr2ogr?

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Mon Dec 15 03:50:06 EST 2008


Hi,

For me it looks like that gml does not contain actual feature coordinates, but the bounding box of the feature. In this case feature is probably a point and feature coordinates and bbox are the same but perhaps a point should be introduced as a point as well?  just thinking, I do not understand much gml.

-Jukka Rahkonen-

> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta 
> Knut Behrends
> Lähetetty: 15. joulukuuta 2008 10:34
> Vastaanottaja: mapserver-users at lists.osgeo.org
> Aihe: [mapserver-users] wfs data conversion with ogr2ogr?
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi all,
> 
> I have received data from a WFS that was returned in this format:
> (Sample feature member)
> 
>   <gml:featureMember>
>     <featureSet_704 fid="featureSet_704-feature_1732">
>       <gml:boundedBy>
>         <gml:Box>
>           <gml:coord>
>             <gml:X>4436682.0</gml:X>
>             <gml:Y>5783076.0</gml:Y>
>           </gml:coord>
>           <gml:coord>
>             <gml:X>4441086.0</gml:X>
>             <gml:Y>5786776.0</gml:Y>
>           </gml:coord>
>         </gml:Box>
>       </gml:boundedBy>
>       <GEOM_ID>1732</GEOM_ID>
>       <NAME>Marienborn</NAME>
>     </featureSet_704>
>   </gml:featureMember>
> 
> ogrinfo can parse the file:
>  ogrinfo SA_PLACES.gml
> Had to open data source read-only.
> INFO: Open of `SA_PLACES.gml'
>       using driver `GML' successful.
> 1: featureSet_704
> 
> ogr2ogr can also convert the file to, say, Esri Shapefile. 
> There isI must assign a source SRS and a target SRS and force 
> a source geometry type.
> 
> INFO: Open of `out/featureSet_704.shp'
>       using driver `ESRI Shapefile' successful.
> 
> Layer name: featureSet_704
> Geometry: Line String
> Feature Count: 100
> Extent: (0.000000, 0.000000) - (0.000000, 0.000000) Layer SRS WKT:
> GEOGCS["GCS_WGS_1984",
>     DATUM["WGS_1984",
>         SPHEROID["WGS_1984",6378137,298.257223563]],
>     PRIMEM["Greenwich",0],
>     UNIT["Degree",0.017453292519943295]]
> GEOM_ID: Real (11.0)
> NAME: String (19.0)
> OGRFeature(featureSet_704):0
>   GEOM_ID (Real) =        1732
>   NAME (String) = Marienborn
> ...
> 
> 
> After successful conversion, however, only the GEOM_ID and 
> the NAME are exported. The spatial information is ignored 
> lost during the conversion.
> Maybe it's in the wrong format, but it is obviously present  
> in the GML fragment above. What can I do to convert the 
> spatial information that is contained in the <X> and <Y> elements?
> 
> Knut
> 
> 
> - --
> ______________________________________________________________
> ______________
> 
> Knut Behrends                         Phone: +49 (0) 331 288 1688
> Potsdam 14473                         KeyID: 0xF22CACEF (PGP 
> Public Key)
> ______________________________________________________________
> ______________
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> 
> iEYEARECAAYFAklGFmYACgkQcfWHNfIsrO9NNACfTwBojDKZ0MU3J/yVUBiof5JP
> P28AnRStqwySPcQ9gM+hjAgQBNZYRZz4
> =Eane
> -----END PGP SIGNATURE-----
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 


More information about the mapserver-users mailing list