[gdal-dev] Re: gdal_translate -unscale option
jt2000
thakkar at nexgenwireless.com
Mon Jul 25 20:05:21 EDT 2011
Frank,
Does the unscale option work as advertised?
I have a raster with offset and scale set.
Driver: GTiff/GeoTIFF
Files: raster.tif
raster.tif.aux.xml
Size is 10295, 7735
Coordinate System is:
PROJCS["unnamed",
GEOGCS["unnamed",
DATUM["North_American_Datum_1983",
SPHEROID["GRS 80",6378137,298.257222101],
TOWGS84[0,0,0,-0,-0,-0,0]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-87],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["Meter",1]]
Origin = (246885.000000000000000,4726455.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left ( 246885.000, 4726455.000) ( 90d 5'15.87"W, 42d38'56.20"N)
Lower Left ( 246885.000, 4494405.000) ( 89d59'22.95"W, 40d33'42.29"N)
Upper Right ( 555735.000, 4726455.000) ( 86d19'10.68"W, 42d41'18.81"N)
Lower Right ( 555735.000, 4494405.000) ( 86d20'28.58"W, 40d35'54.87"N)
Center ( 401310.000, 4610430.000) ( 88d11' 5.93"W, 41d38'22.21"N)
Band 1 Block=10295x1 Type=Float32, ColorInterp=Gray
* NoData Value=0
Offset: -200, Scale:0.00305185094759972*
when I do a gdallocationinfo on it, i get the value of -90.82 as follows:
gdallocationinfo -b 1 raster.tif 3000 3342
Report:
Location: (3000P,3342L)
Band 1:
Value: -90.8230819702148
Descaled Value: -200.277178508775
Applying unscale
gdal_translate -unscale -of GTiff ~/raster.tif raster2.tif
gdallocationinfo -b 1 raster2.tif 3000 3342
Report:
Location: (3000P,3342L)
Band 1:
Value: -200.27717590332
I would have expected -90.82 as the value. Am I wrong?
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/gdal-translate-unscale-option-tp4237854p6620565.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the gdal-dev
mailing list