[gdal-dev] Question to ogr2ogr

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Tue Jun 3 04:44:07 PDT 2014


Dr. Kai Behncke <behncke <at> creativista-solutions.de> writes:

> 
> Dear Developers,
> 
> I would like to know if ogr2ogr has also implemented the transformation
> DHDN_To_ETRS_1989_8_NTv2-Transformation and if so, how it`s possible to
use it?
> 
> The background: I have a shape in the German Gauss Krueger Zone 4 and I
tried to transform it with "ogr2ogr
> -t_srs epsg:25832" to ETRS UTM 32N, but it lays always 2 meter next to the
position where it belongs to (also
> then, when I first tried to reproject it fist to wgs 84 and then to utm32N).
> 
> then I tried it with ArcGIS and the
DHDN_To_ETRS_1989_8_NTv2-Transformation and then it fits well....
> 
> Thank you very much, Kai

For the accurate transformations you need to have a grid shift file and you
must tell that GDAL must use it by adding +nadgrids to the Proj4 projection
string. I found from my computer this definition 

# DHDN / 3-degree Gauss zone 4 (deprecated)
<31464> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0
+datum=potsdam +units=m +no_defs  <>

By looking at document
http://support.esri.com/en/knowledgebase/techarticles/detail/18317 it looks
that you will need a file named "BETA2007.gsb". Find and copy it from your
ESRI installation into your GDAL data directory. Your ogr2ogr command should
be then 

ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=tmerc +lat_0=0 +lon_0=12 +k=1
+x_0=4500000 +y_0=0 +datum=potsdam +nadgrids=BETA2007.gsb +units=m +no_defs"
-t_srs epsg:25832 output.shp input.shp

No guarantee that this works but have a try, it will take only couple of
minutes. Run ogr2ogr with --debug ON and I suppose that it will tell you if
it finds the grid shift file.

-Jukka Rahkonen-





More information about the gdal-dev mailing list