[Proj] Help with use of swisstopo NTv2 grid shift ?

Paul Kelly paul-grass at stjohnspoint.co.uk
Mon Jan 23 12:22:03 EST 2012

On Mon, 23 Jan 2012, Sandro Santilli wrote:

> Hello everyone,
> I'm trying to understand how to use the swisstopo grid shift
> CHENYX06a.gsb file and would like to ask if anyone of you used
> it already.
> Following instructions found on this message:
> http://lists.maptools.org/pipermail/proj/2009-January/004297.html

That was written by me, although it's not particularly clear - and neither 
was I particularly clear on it at the time, though I vaguely remember 
someone later reported back that the solution worked. I haven't tried it 
myself, so I can only offer some hints.

> But when trying to convert, proj4 reports that the gridshift file is only
> valid within the following range of coordinates:
> NTv2 CHENyx06 661x313: LL=(5.55,45.4666667) UR=(11.05,48.0666667)
> pj_apply_gridshift(): failed to find a grid shift table for
>                      location (759183.2731993dW,187561.6170195dN
> This surprised me as the .asc version of the gridshift seems to
> contain a different range:
> S_LAT     163680.000000
> N_LAT     173040.000000
> E_LONG    -39780.000000
> W_LONG    -19980.000000

No, this is exactly the same as the bounds reported by PROJ.4. Those 
values are in degree-seconds. You need to divide by 3600 to get them in 
degrees (and note also that the longitude values are positive west of the 
Greenwich meridian; you need to divide them by -3600).

> I've prepared a couple of definitions pretending that the target
> (CH1903+) was a WGS84 and defined the input (CH1903) as needing
> the CHENYX06a.gsb gridshift:
> Source:
>  +proj=longlat +ellps=WGS84 +nadgrids=CHENYX06a.gsb +no_defs
> Target:
>  +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs

I suspect you may have gone a little too far in "pretending" that you're 
using WGS84! Are your co-ordinates really in latitude/longitude? The very 
large numbers shown in the error message suggest that you have projected 
co-ordinates; see below:

> pj_apply_gridshift(): failed to find a grid shift table for
>                      location (759183.2731993dW,187561.6170195dN
                                  ^^^^^^           ^^^^^^

I think you need to set up your co-ordinate system definition strings to 
specify the correct projection and ellipsoid that you are using.


More information about the Proj mailing list