Opened 15 years ago

Closed 15 years ago

#3040 closed defect (fixed)

GDALWarp produces wrong output when going from NAD27 UTM to WGS84 UTM (Zone 10)

Reported by: edomazlicky Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

GDALWarp (and it seems the GDAL library itself) is not producing the correct output when projecting from NAD27 UTM to WGS84 UTM (Zone 10 all I tested). This bug can be reproduced using FWTools 2.4.0 which seems to use a recent SVN version of GDALWarp. The file I used was the DRG of the Mount Rainier West Quad availabe here: http://rocky2.ess.washington.edu/data/raster/drgclip/yakima/o46121g7.zip

And the command I used was: gdalwarp -t_srs epsg:32610 o46121g7.tif o46121g7_new.tif Then I set my environment to FWTools 2.2.8 and re-ran the same command and compared the two files. You can see from the attached gdalinfo dumps that there are significant differences in the Origin between the old version and new version. As a consequence the file itself it not projected correctly, points such as the summit of Mount Rainier 46.8528773, -121.7604938 (WGS84) do not line up correctly.

Attachments (3)

new.txt (5.9 KB ) - added by edomazlicky 15 years ago.
GDALInfo dump from SVN version
new.2.txt (5.9 KB ) - added by edomazlicky 15 years ago.
GDALInfo dump from SVN version
old.txt (5.9 KB ) - added by edomazlicky 15 years ago.
GDALInfo dump from older version

Download all attachments as: .zip

Change History (5)

by edomazlicky, 15 years ago

Attachment: new.txt added

GDALInfo dump from SVN version

by edomazlicky, 15 years ago

Attachment: new.2.txt added

GDALInfo dump from SVN version

by edomazlicky, 15 years ago

Attachment: old.txt added

GDALInfo dump from older version

comment:1 by Even Rouault, 15 years ago

Looks like it is related to proj.4 and NAD27->NAD83/WGS84 shift

With proj 4.6.1 configured with proj-datumgrid-1.4.zip (the reprojection uses ntv1_can.dat) and GDAL trunk, under Linux, I get the following result after gdalwarp :

Upper Left  (  585634.900, 5192011.110) (121d52'34.30"W, 46d52'34.04"N)
Lower Left  (  585634.900, 5177978.049) (121d52'43.76"W, 46d44'59.50"N)
Upper Right (  595381.232, 5192011.110) (121d44'53.95"W, 46d52'29.26"N)
Lower Right (  595381.232, 5177978.049) (121d45'4.49"W, 46d44'54.75"N)
Center      (  590508.066, 5184994.580) (121d48'49.13"W, 46d48'44.45"N)

which is exactly the same result as 'old.txt'. I also tried FWTools 2.2.8, FWTools2.4.0 and FWTools2.4.2 (under Wine) and I always get the same results as above, so I think there was probably something wrong in your setup when you got new.txt. Did you run setfw.bat to setup correctly the necessary environment variables ?

comment:2 by edomazlicky, 15 years ago

Resolution: fixed
Status: newclosed

I was using setfw.bat to establish the environment. However, I did have GDAL_DATA set to the FWTools2.4.0 data directory, also had FWTools2.4.0/bin set in the last part of my PATH. After I took both of those environment variables out it worked fine.

Note: See TracTickets for help on using tickets.