[Proj] Using a GDAL-generated NTV2-file

Jan Hartmann j.l.h.hartmann at uva.nl
Sat May 21 07:12:31 EST 2011


On 05/03/11 16:25, Frank Warmerdam wrote:
>
> I just tried and ran into the same thing.  It is because NTv2 format also
> has two error range bands.  Try creating a four band find with the 
> last two
> bands all zeros.

Hi Frank,

I was able to create a valid NTV2 file from a four-band raster tif (see 
gdalinfo output below). First two bands are displacements in lon and lat 
(arcseconds), last two are zero. When I use that file in a +nadgrids 
clause in proj, I get the following error:

GS_COUNT(160000) does not match expected cells (400x-397=-158800)

Any idea ?

Jan

-----------------------------------------------------------------------------------------------------------------------------------------------------------

$ gdalinfo test.ntv2
Driver: NTv2/NTv2 Datum Grid Shift
Files: test.ntv2
Size is 400, 400
Coordinate System is:
GEOGCS["WGS 84",
     DATUM["WGS_1984",
         SPHEROID["WGS 84",6378137,298.257223563,
             AUTHORITY["EPSG","7030"]],
         TOWGS84[0,0,0,0,0,0,0],
         AUTHORITY["EPSG","6326"]],
     PRIMEM["Greenwich",0,
         AUTHORITY["EPSG","8901"]],
     UNIT["degree",0.0174532925199433,
         AUTHORITY["EPSG","9108"]],
     AUTHORITY["EPSG","4326"]]
Origin = (3.386235000000001,50.762069400000001)
Pixel Size = (0.009627452750000,0.007066402750000)
Metadata:
   GS_TYPE=SECONDS
   VERSION=
   SYSTEM_F=
   SYSTEM_T=
   MAJOR_F=0
   MINOR_F=0
   MAJOR_T=0
   MINOR_T=0
   SUB_NAME=
   PARENT=NONE
   CREATED=
   UPDATED=
Subdatasets:
   SUBDATASET_0_NAME=NTv2:0:test.ntv2
   SUBDATASET_0_DESC=
Corner Coordinates:
Upper Left  (   3.3862350,  50.7620694) (  3d23'10.45"E, 50d45'43.45"N)
Lower Left  (   3.3862350,  53.5886305) (  3d23'10.45"E, 53d35'19.07"N)
Upper Right (   7.2372161,  50.7620694) (  7d14'13.98"E, 50d45'43.45"N)
Lower Right (   7.2372161,  53.5886305) (  7d14'13.98"E, 53d35'19.07"N)
Center      (   5.3117256,  52.1753499) (  5d18'42.21"E, 52d10'31.26"N)
Band 1 Block=400x1 Type=Float32, ColorInterp=Undefined
   Description = Latitude Offset
Band 2 Block=400x1 Type=Float32, ColorInterp=Undefined
   Description = Longitude Offset
Band 3 Block=400x1 Type=Float32, ColorInterp=Undefined
   Description = Latitude Error
Band 4 Block=400x1 Type=Float32, ColorInterp=Undefined
   Description = Longitude Error

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20110521/e4943e8c/attachment.htm 


More information about the Proj mailing list