[gdal-dev] ogr2ogr not recognizing source SRS correctly

Even Rouault even.rouault at spatialys.com
Thu Feb 1 02:45:59 PST 2018


On jeudi 1 février 2018 11:20:46 CET Christoph Paulik wrote:
> Hi,
> 
> I've got a shapefile in EPSG:28992 -
> http://spatialreference.org/ref/epsg/amersfoort-rd-new/ which I want to
> project into a different EPSG.
> 
> But this leads to a shift in the projected output if I don't explicitly
> specify the s_srs option in ogr2ogr.
> 
> So
> 
> ogr2ogr AA-maas-EPGS-4326.shp AaMaas.shp -t_srs EPSG:4326 -s_srs EPSG:28992
> 
> works correctly
> 
> But doing
> 
> ogr2ogr AA-maas-EPGS-4326.shp AaMaas.shp -t_srs EPSG:4326
> 
> leads to a shift of the shapefile.
> 
> The .prj file is of course there.
> 
> Should I file a bug or am I doing something wrong?

Christoph,

Shapefiles .prj files do not contain the TOWGS84 clause used to perform datum shifts. With 
currently released GDAL versions, this TOWGS84 clause will be missing when using directly 
the SRS from the source, and you need to explicitly set it with -s_srs EPSG:28992.
The situation should likely be better with GDAL trunk that has improved logic to try figuring 
out the EPSG code (and thus the TOWGS84 clause) from the .proj file

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180201/cfde3c68/attachment.html>


More information about the gdal-dev mailing list