Saturday 24 February 2018

How to set GDAL/cs2cs/proj to use NTv2 grid shift file when using EPSG codes?


I am using the GDAL API for Python for a script that takes only EPSG codes for inputs to specify source and target coordinate systems.


While the cs2cs command seems to handle quite well transformation between NAD27 (EPSG:4267) and NAD83 (EPSG:4326) coordinates in North America, I would like to have similar capabilities for AGD66 (EPSG:4202) to GDA94 (EPSG:4283) and AGD84 (EPSG:4203) to GDA94 (EPSG:4283) in Australia.


When using the -v option with cs2cs to look at the proj string being used i get the following:


    >cs2cs -v +init=epsg:4267
># ---- From Coordinate System ----
>#Lat/long (Geodetic alias)
>#
># +init=epsg:4267 +proj=longlat +datum=NAD27 +no_defs +ellps=clrk66

># +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat
># ---- To Coordinate System ----
>#Lat/long (Geodetic alias)
>#
># +proj=latlong +datum=NAD27 +ellps=clrk66
># +nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat

The nadgrids parameters tells cs2cs to use the best fitting datum grid shift file from conus, alaska, ntv2_0.gsb, and ntv1_can.dat.


For AGD66 (EPSG:4202) cs2cs returns:


    >cs2cs -v +init=epsg:4202

># ---- From Coordinate System ----
>#Lat/long (Geodetic alias)
>#
># +init=epsg:4202 +proj=longlat +ellps=aust_SA
># +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29 +no_defs
># ---- To Coordinate System ----
>#Lat/long (Geodetic alias)
>#
># +proj=latlong +ellps=aust_SA
># +towgs84=-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29


There is no nadgrids parameter but a towgs84 instead. A grid shift file from the ICSM; "A66 National (13.09.01).gsb" contains the shift between AGD66 and GDA94.


How can I make GDAL/cs2cs/proj identify this file when using EPSG codes?


I tried to reinstall GDAL/cs2cs/proj using the osgeo4w installer with A66 National (13.09.01).gsb within the directory containing the other datum shift files prior to the reinstallation but without success.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...