[Gdal-dev] AAIGrid driver reading Floating points incorrectly?
Bryan Keith
bryan at geomega.com
Thu Jul 13 15:50:39 EDT 2006
I have a Float32 tif (see gdalinfo below) that I translate to a Float32
AAIGrid (see gdal_translate below). After the translation gdalinfo
reports the dataset as Int16 and reports the grid maximum vastly
different than it was before (see gdalinfo below). The output aaigrid
file is indeed floating point (see head output below) even though
gdalinfo says it's int16. When I translate this aaigrid back to a tif,
then the new gdalinfo tif report is the same as the gdalinfo aaigrid (I
didn't paste this stuff). When I translate the aaigrid to an ArcInfo
binary grid (AIG) using ArcInfo, then the output is the same as the
original tif. The gdalinfo report for the AIG dataset is the same as
the original tif. So it appears that the aaigrid writer is working
correctly, but the aaigrid reader isn't working as expected.
A bug or am I doing something wrong?
Bryan
>gdalinfo elkw_g.tif -mm
Driver: GTiff/GeoTIFF
Size is 174, 225
Coordinate System is:
Origin = (683628.000000,2280258.125000)
Pixel Size = (1640.00000000,-1640.00000000)
Metadata:
AREA_OR_POINT=Area
Corner Coordinates:
Upper Left ( 683628.000, 2280258.125) (116d 0'4.59"W, 41d 0'38.27"N)
Lower Left ( 683628.000, 1911258.125) (116d 0'40.36"W, 39d59'51.82"N)
Upper Right ( 968988.000, 2280258.125) (114d58'3.19"W, 41d 0'0.09"N)
Lower Right ( 968988.000, 1911258.125) (114d59'34.47"W, 39d59'14.98"N)
Center ( 826308.000, 2095758.125) (115d29'35.81"W, 40d30'0.47"N)
Band 1 Block=174x11 Type=Float32, ColorInterp=Gray
Computed Min/Max=1523.000,3385.788
NoData Value=-99999
>gdal_translate -of AAIGrid -ot Float32 elkw_g.tif elkw_g.asc
Input file size is 174, 225
0...10...20...30...40...50...60...70...80...90...100 - done.
>gdalinfo elkw_g.asc -mm
Driver: AAIGrid/Arc/Info ASCII Grid
Size is 174, 225
Coordinate System is:
Origin = (683628.000000,2280258.125000)
Pixel Size = (1640.00000000,-1640.00000000)
Corner Coordinates:
Upper Left ( 683628.000, 2280258.125) (116d 0'4.59"W, 41d 0'38.27"N)
Lower Left ( 683628.000, 1911258.125) (116d 0'40.36"W, 39d59'51.82"N)
Upper Right ( 968988.000, 2280258.125) (114d58'3.19"W, 41d 0'0.09"N)
Lower Right ( 968988.000, 1911258.125) (114d59'34.47"W, 39d59'14.98"N)
Center ( 826308.000, 2095758.125) (115d29'35.81"W, 40d30'0.47"N)
Band 1 Block=174x1 Type=Int16, ColorInterp=Undefined
Computed Min/Max=1523.000,31073.000
NoData Value=-99999
>head -n 7 elkw_g.asc
ncols 174
nrows 225
xllcorner 683628.000000000000
yllcorner 1911258.125000000000
cellsize 1640.000000000000
NODATA_value -99999
-99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -9
9999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -9999
9 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -
99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -999
99 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999
-99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -99
999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -99999
-99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -9
9999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -9999
9 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -
99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
-99999 -999
99 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999 -99999
1928.612915039
0625 1965.587158203125 1994.283447265625 2013.431396484375
1997.0623779296875 21
11.51416015625 2196.006103515625 2292.074951171875 2427.913818359375
2483.550048
828125 2456.762939453125 2558.080322265625 2680.93896484375
2807.83984375 2850.4
55810546875 3076.365234375 3124.860107421875 2905.718017578125
2704.766845703125
2457.794189453125 2327.631591796875 2239.057861328125 2135.4072265625
2071.9897
4609375 2032.28515625 1985.5416259765625 1948.4173583984375
1905.1170654296875 1
875.913818359375 1839.749755859375 1824.07958984375 1820.505126953125
1806.35302
734375 1767.8443603515625 -99999 -99999 -99999 -99999 -99999
Bryan Keith
GIS Specialist
Geomega, Inc.
Boulder, CO, USA
More information about the Gdal-dev
mailing list