[GRASS5] [bug #3029] (grass) NTv2 grid file out-of-bounds errors

this bug's URL: http://intevation.de/rt/webrt?serial_num=3029
-------------------------------------------------------------------------

Subject: NTv2 grid file out-of-bounds errors

If I pan off the edge of a NTv2 grid file coverage, I get this error:

g.region -l

pj_transform() failed
cause: failed to load NAD27-83 correction file
ERROR: Error in pj_do_proj (projection of input coordinate pair)

panning back a little, it's ok:

d.zoom -p
g.region -l

long: 166.39533 lat: -45.02641 (north/west corner)
long: 167.66148 lat: -45.09204 (north/east corner)
long: 167.53431 lat: -46.43873 (south/east corner)
long: 166.23759 lat: -46.37130 (south/west corner)
rows: 30
cols: 20
Center Longitude: 166:57:25.838015E [166.95718]
Center latitude: 45:43:55.628939S [-45.73212]

proj: nzmg
datum: nzgd49
list: 1 (NTv2)

g.proj -p

-PROJ_INFO-------------------------------------------------
name : New Zealand Map Grid
datum : nzgd49
nadgrids : nzgd2kgrid0005.gsb
proj : nzmg
ellps : international
a : 6378388.0000000000
es : 0.0067226700
f : 297.0000000000
lat_0 : -41.0000000000
lon_0 : 173.0000000000
x_0 : 2510000.0000000000
y_0 : 6023150.0000000000
-PROJ_UNITS------------------------------------------------
unit : meter
units : meters
meters : 1.0

working region:

g.region -g

n=5555000
s=5405000
w=1990000
e=2090000
nsres=5000
ewres=5000

failing region:

g.region -g

n=5555000
s=5405000
w=1935000
e=2035000
nsres=5000
ewres=5000

(also happens with ps.map's geogrid function if you stray too far past the
edge of the coastline)

Everything works fine from the 7 or 3-param transform params.

I am not suggesting that we should revert to the 7 or 3 projection transform
params if the grid is out of bounds as this may have unforseen consequences to
assumed data quality etc. for the ?.proj modules?. Not really sure if there is
an answer to this one.

?,
Hamish

-------------------------------------------- Managed by Request Tracker