[gdal-dev] How to set GDAL/cs2cs/proj to use NTv2 grid shift file when using EPSG codes?

Thomas Campagne thomasc at mirageoscience.com
Wed May 22 11:42:54 PDT 2013


Thanks André!

I will add a line for AGD66 datum and nadgrid file in pj_datums.c, and make the appropriate change in the epsg file , and compile from source. 

Is possible to default to the use of +towgs84 when there is no successful grids with +nadgrids?

For New-Zealand the line in pj_datums.c is:
"nzgd49",	"nadgrids=nzgd2kgrid0005.gsb", 	"intl",	 "New Zealand Geodetic Datum 1949"
And the epsg file contains:
# NZGD49
<4272> +proj=longlat +datum=nzgd49 +no_defs  <>

Could the following work if points are not located within the area covered by the NTv2 file?

pj_datums.c contains:
"nzgd49",	" nadgrids=@nzgd2kgrid0005.gsb ", 	"intl", "New Zealand Geodetic Datum 1949"
And the epsg file contains:
# NZGD49
<4272> +proj=longlat +datum=nzgd49 + towgs84=59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993 +no_defs  <>



-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Andre Joost
Sent: May-17-13 10:21 AM
To: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] How to set GDAL/cs2cs/proj to use NTv2 grid shift file when using EPSG codes?

Am 17.05.2013 19:00, schrieb Thomas Campagne:

> When I run cs2cs -v +init=epsg:4267 I still do not understand how the
> +nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat parameter is being
> generated as I cannot find it within the text/csv files.
>

EPSG:4267 expands to
+proj=longlat +datum=NAD27 +no_defs

and the nadgrids are in the "+datum=NAD27". This is hardcoded in <http://trac.osgeo.org/proj/browser/trunk/proj/src/pj_datums.c>
> "NAD27",    "nadgrids=@conus, at alaska, at ntv2_0.gsb, at ntv1_can.dat",
> 	                                                     "clrk66",
> 	                                "North_American_Datum_1927",


> Any idea about which files to edit to add the nadgrids parameter to 
> the proj string referenced by a given EPSG code (4202 for AGD66 as 
> example)?


You could add a line for AGD66 datum and nadgrid file in the file, and compile from source. And you have to change the share/proj/epsg file to use your datum istead of +towgs84.

Or try to insert the +nadgrids=<filename> for the AGD66 entry directly.

HTH,
André Joost


_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list