[gdal-dev] ogr2ogr not recognizing source SRS correctly

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] ogr2ogr not recognizing source SRS correctly

Christoph Paulik

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?

All the best,
Christoph


--

-------------------------------------------------------
Christoph Paulik
VanderSat // Remote Sensing Scientists
Wilhelminastraat 43a, 2011 VK, Haarlem (NL), The Netherlands
W: www.vandersat.com
PGP: 8CFC D7DF 2867 B2DC 749B  1B0A 6E3B A262 5186 A0AC

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

signature.asc (847 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ogr2ogr not recognizing source SRS correctly

Even Rouault-2

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


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev