[gdal-dev] myshape.prj versus -s_srs

winkey rush at winkey.org
Thu Jan 17 12:50:27 EST 2008


does this include apps like gdal_contour?

ie: gdal_contour -i 1 myraster -f KML mykml.kml

thanks
brian

On Wed, 2008-01-16 at 22:09 -0500, Frank Warmerdam wrote:
> Stefan Keller wrote:
> > I'm trying to a shapefile to KML. The Shapefile driver indicates that 
> > "If a .prj files (...) is present, it will be read and used to associate 
> > a projection with features.". In addition, the OGR KML driver 
> > documentation says "All OGR KML output will be presented in EPSG:4326.".
> >  
> > Let's say the input files are myshape.shp, myshape.shx, myshape.dbf and 
> > myshape.prj and I try "ogr2ogr -f kml out.kml myshape.shp".
> > then the resulting coordinates are still in the source coordinate 
> > system: Why? I espected that theya re transformed to WGS84 according to 
> > the documentation mentioned.
> >  
> > This is what finally worked: "ogr2ogr -f kml del_prairie.kml 
> > del_prairie.shp -s_srs EPSG:21781 -t_srs EPSG:4326". But indicating 
> > "-s_srs EPSG:21781" seems to me redundant to the existing file 
> > myshape.prj . Any explanations?
> 
> Stefan,
> 
> ogr2ogr does not reproject coordinates by default, even when writing
> to formats like KML that only really support one output coordinate system
> properly.  The -t_srs is the correct way to request reprojection.
> 
> The -s_srs EPSG:21781 option should be unnecessary if the source shapefile
> already has a readable .prj file.
> 
> Best regards,



More information about the gdal-dev mailing list