[Gdal-dev] trouble converting units in raster images

Jeff Hoffmann jeff at propertykey.com
Fri Nov 4 17:09:58 EST 2005


I have a raster layer that is composed of a few hundred GeoTIFF files; 
all of the files are NAD83 / Alabama West, although some have the units 
set to meters, other are feet.  I'm trying to get them all to the same 
units, but I can't figure out how to do that.  I'm trying to do it with 
gdalwarp (with parameters "-s_srs '+init=epsg:26930 +units=ft' -t_srs 
'+init=epsg:26930'").  I'm using GDAL version 1.3.1.0.  The command 
changes the coordinate system information when I do a gdalinfo on the 
file, but the origin, pixel size, corner coordinates all stay the same 
numbers.  Is there something I'm not doing right?  It seems like it 
should be pretty straightforward.  Or is there some other way to 
accomplish this if it just won't work?

Here's the output of gdalinfo for the source image:
Driver: GTiff/GeoTIFF
Size is 11901, 11901
Coordinate System is:
PROJCS["NAD83 / Alabama West",
     GEOGCS["NAD83",
         DATUM["North_American_Datum_1983",
             SPHEROID["GRS 1980",6378137,298.2572221010042,
                 AUTHORITY["EPSG","7019"]],
             AUTHORITY["EPSG","6269"]],
         PRIMEM["Greenwich",0],
         UNIT["degree",0.0174532925199433],
         AUTHORITY["EPSG","4269"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",30],
     PARAMETER["central_meridian",-87.5],
     PARAMETER["scale_factor",0.999933333],
     PARAMETER["false_easting",1968503.937007874],
     PARAMETER["false_northing",0],
     UNIT["foot",0.3048,
         AUTHORITY["EPSG","9002"]],
     AUTHORITY["EPSG","26930"]]
Origin = (2258137.650000,1143690.600000)
Pixel Size = (0.50000000,-0.50000000)
Metadata:
   AREA_OR_POINT=Area
   TIFFTAG_XRESOLUTION=0
   TIFFTAG_YRESOLUTION=0
   TIFFTAG_RESOLUTIONUNIT=1 (unitless)
Corner Coordinates:
Upper Left  ( 2258137.650, 1143690.600) ( 86d33'13.69"W, 33d 8'25.96"N)
Lower Left  ( 2258137.650, 1137740.100) ( 86d33'14.32"W, 33d 7'27.09"N)
Upper Right ( 2264088.150, 1143690.600) ( 86d32'3.72"W, 33d 8'25.42"N)
Lower Right ( 2264088.150, 1137740.100) ( 86d32'4.36"W, 33d 7'26.55"N)
Center      ( 2261112.900, 1140715.350) ( 86d32'39.02"W, 33d 7'56.25"N)
Band 1 Block=256x256 Type=Byte, ColorInterp=Gray
   Overviews: 5950x5950, 2975x2975, 1487x1487, 743x743, 371x371, 
185x185, 92x92, 46x46

The gdalinfo for the resulting image is:
Driver: GTiff/GeoTIFF
Size is 11901, 11901
Coordinate System is:
PROJCS["NAD83 / Alabama West",
     GEOGCS["NAD83",
         DATUM["North_American_Datum_1983",
             SPHEROID["GRS 1980",6378137,298.2572221010042,
                 AUTHORITY["EPSG","7019"]],
             AUTHORITY["EPSG","6269"]],
         PRIMEM["Greenwich",0],
         UNIT["degree",0.0174532925199433],
         AUTHORITY["EPSG","4269"]],
     PROJECTION["Transverse_Mercator"],
     PARAMETER["latitude_of_origin",30],
     PARAMETER["central_meridian",-87.5],
     PARAMETER["scale_factor",0.999933333],
     PARAMETER["false_easting",600000],
     PARAMETER["false_northing",0],
     UNIT["metre",1,
         AUTHORITY["EPSG","9001"]],
     AUTHORITY["EPSG","26930"]]
Origin = (2258137.650000,1143690.600000)
Pixel Size = (0.50000000,-0.50000000)
Metadata:
   AREA_OR_POINT=Area
Corner Coordinates:
Upper Left  ( 2258137.650, 1143690.600) ( 68d30'8.16"W, 38d43'40.10"N)
Lower Left  ( 2258137.650, 1137740.100) ( 68d30'58.27"W, 38d40'37.64"N)
Upper Right ( 2264088.150, 1143690.600) ( 68d26'15.32"W, 38d43'0.73"N)
Lower Right ( 2264088.150, 1137740.100) ( 68d27'5.58"W, 38d39'58.34"N)
Center      ( 2261112.900, 1140715.350) ( 68d28'36.83"W, 38d41'49.22"N)
Band 1 Block=11901x1 Type=Byte, ColorInterp=Gray


-- 
Jeff Hoffmann
jeff at propertykey.com



More information about the Gdal-dev mailing list