NTv2 Transformation to ETRS89 for Austria(MGI) the commmand-line way (ogr2ogr)

Sometimes (eg. doing it for a bulk of geodatasets) converting and transforming geodatasets from their Source-CRS to another with command line tools like ogr2ogr (http://www.gdal.org/ ) can be helpful.

With ogr2ogr it’s also an easy task to use NTv2-based transformations like for Austria the AT_GIS_GRID.

The following syntax did a good job in my case – the results have been identical using ArcMap or QGIS.

Before you start download the AT_GIS_GRID from the BEV (http://www.bev.gv.at).

The basic syntax for a geodataset based on the Austrian MGI (in this for a dataset in GK/West – EPSG:31254):

ogr2ogr -f "ESRI Shapefile" -s_srs "+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs +nadgrids=AT_GIS_GRID.gsb" -t_srs "EPSG:4258" Targetfile.shp Sourcefile.shp

In my case using ogr2ogr worked really good and FAST ! The results did not differ from a reference dataset transformed with ArcMap.

Depending on the Source-SRS replace the “-s_srs”-Parameters. At the end of the article the most common are listed.

If you don’t like working with the command line use AT_GIS_GRID Transformations with…

The most common “s_srs”-definitions for Austria (for those who like Copy&Paste, but don’t forget to integrate the AT_GIS_GRID in the syntax)

EPSG:31254 (Austria GK West)
+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

EPSG:31255 (Austria GK Central)
+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

EPSG:31256 (Austria GK East)
+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=0 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

EPSG:31257 (Austria GK M28)
+proj=tmerc +lat_0=0 +lon_0=10.33333333333333 +k=1 +x_0=150000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

EPSG:31258 (Austria GK M31)
+proj=tmerc +lat_0=0 +lon_0=13.33333333333333 +k=1 +x_0=450000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs

EPSG:31259 (Austria GK M34)
+proj=tmerc +lat_0=0 +lon_0=16.33333333333333 +k=1 +x_0=750000 +y_0=-5000000 +ellps=bessel +towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232 +units=m +no_defs