[gdal-dev] Specifying projections

Even Rouault even.rouault at mines-paris.org
Wed Jun 10 17:19:18 EDT 2009


Nicholas,

this is a actually a good point. I've just improved ogr2ogr (svn trunk r17229) 
so that it sets the spatial coordinate system on each individual geometry 
when -a_srs is specified, in addition to the destination layer. This way 
the 'srsName' attribute will be written for each output GML geometry.

With your current version of OGR, you can use the following workaround. 
Instead of using -a_srs, you can specify both -s_srs and -t_srs, so that a 
reprojection (that won't do anything) occurs, which sets the destination SRS 
on each geometry.

ogr2ogr -f GML -s_srs EPSG:XXXX -t_srs EPSG:XXXX out.gml in.shp

Other point to be aware of : the GML driver doesn't support reading the 
coordinate system. It will just ignore the srsName attribute on a feature.

Best regards,

Even

Le Wednesday 10 June 2009 22:39:20 Nicholas Efremov-Kendall, vous avez écrit :
> Hi all,
>
> I apologize for the somewhat beginner's question but here goes: I'm trying
> to convert a shp file to GML. The shp file doesn't have a projection
> defined for it, and I use the -a_srs" "EPSG:XXXX" -fileout -filein format.
> When I convert them this way, the gml doesn't contain a bounding box or
> information on the projection, although I explicitly assign a coordinate
> system (or think I am). Does anyone have any suggestions on why this is
> happening, and what I can do to resolve this issue?




More information about the gdal-dev mailing list