[gdal-dev] Odd things after using ogr2ogr

Frank Warmerdam warmerdam at pobox.com
Thu Oct 23 11:15:07 EDT 2008


Kai Behncke wrote:
> Dear Frank,
> 
> thank you for that hint.
> 
>> I imagine there is an issue with how the datum shifting is being done.
>> It looks to me that by default EPSG:31467 does not have datum shift
>> parameters supplied with it (as expected by GDAL/OGR).
> 
> Is there a possibility to put this datum shift parameters manually?

Kai,

Yes, it should be possible though perhaps tricky.

With ogr2ogr you can replace EPSG:31467 with a PROJ.4 style definition
instead which would look like this:

   +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +datum=potsdam

without any datum shift parameters.  Doh! I see that in fact this
does have datum shift parameters since +datum=potsdam expands internally
within PROJ.4 to:

   +towgs84=606.0,23.0,413.0 +ellps=bessel

OK - so EPSG:31467 is likely fine.  I imagine the problem then is that
QGIS is not associating appropriate datum shift parameters when back-shifting.
I tried assigning EPSG:31467 to a shapefile here, and then examining what
OGR uses as the PROJ.4 translation and got:

   +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel

So the problem appears to be that once the coordinate system is converted
to ESRI WKT format (in the .prj file associated with the shapefile) the
relationship of the coordinate system to the potsdam DHDN 1950 datum is
lost - at least as far as OGR can work out.  So presumably the datum
shift is properly applied by ogr2ogr, but thereafter OGR (and consequently
QGIS) does not recognise the datum properly.

This is a common sort of problem.  Even when we know the properly EPSG
datum shift info it is often lost when the coordinate system is converted
to less expressive file formats.

One work around would be to add some specific translation rules
for datums named D_Deutsches_Hauptdreiecksnetz in the OGR
morphFromESRI() code but this would need to be done on a case by
case basis for all datums of interest and to be honest I'm not even
sure OGR is converting this to the expected ESRI datum name.

Grr.  I'm so sick of coordinate system related issues!

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list