[Gdal-dev] gdal_translate ESRI grid question

Juliana Lo juliana at pdc.org
Thu Feb 24 02:41:42 EST 2005


I am a newbie to gdal, so please forgive me if this question has been asked before.
I am trying to translate a ESRI float grid flt file to geotiff, from 4 bytes floating to unsiged byte. 
 
# gdal_translate -ot Byte T_02160000.flt T_02160000.tif
Input file size is 321, 225
0...10...20...30...40...50...60...70...80...90...100 - done.

The input min/max = 40.2 /  83.22. When I looked at the output., the data values are all 0's and 255's.

Also tried scale option -scale 40 80 0 255, same output.
 
gdalinfo -mm is not reporting correct statistics
        Computed Min/Max=-288880055582332026880.000,272238237990107188559872.000

 
# gdalinfo -mm T_02160000.flt
Driver: EHdr/ESRI .hdr Labelled
Size is 321, 225
Coordinate System is:
GEOGCS["NCEP_SPHERE",
    DATUM["NCEP_SPHERE",
        SPHEROID["NCEP_SPHERE",6371200.0,0.0]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199432955]]
Origin = (-17975051.662435,2603061.701239)
Pixel Size = (2500.00000000,-2500.00000000)
Corner Coordinates:
Upper Left  (-17975051.662, 2603061.701) (17975051d39'64424509484.77"W,2603061d42'8589934596.46"N)
Lower Left  (-17975051.662, 2040561.701) (17975051d39'64424509484.77"W,2040561d42'8589934596.46"N)
Upper Right (-17172551.662, 2603061.701) (17172551d39'60129542188.77"W,2603061d42'8589934596.46"N)
Lower Right (-17172551.662, 2040561.701) (17172551d39'60129542188.77"W,2040561d42'8589934596.46"N)
Center      (-17573801.662, 2321811.701) (17573801d39'64424509484.77"W,2321811d42'8589934596.46"N)
Band 1 Block=321x1 Type=Float32, ColorInterp=Undefined
    Computed Min/Max=-288880055582332026880.000,272238237990107188559872.000

# gdalinfo -mm T_02160000.tif
Driver: GTiff/GeoTIFF
Size is 321, 225
Coordinate System is:
GEOGCS["NCEP_SPHERE",
    DATUM["unknown",
        SPHEROID["unnamed",6371200,1]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433]]
Origin = (-17975051.662435,2603061.701239)
Pixel Size = (2500.00000000,-2500.00000000)
Corner Coordinates:
Upper Left  (-17975051.662, 2603061.701) 
Lower Left  (-17975051.662, 2040561.701) 
Upper Right (-17172551.662, 2603061.701) 
Lower Right (-17172551.662, 2040561.701) 
Center      (-17573801.662, 2321811.701) 
Band 1 Block=321x25 Type=Byte, ColorInterp=Gray
    Computed Min/Max=0.000,255.000

# cat T_02160000.hdr
ncols 321
nrows 225
cellsize 2500.000000
xllcorner -17973801.662435
yllcorner 2041811.701239
byteorder msbfirst

 
# cat T_02160000.txt
PDS-S0 | DataType | 0 (Meteorological products)
PDS-S1 | Originating center | 8
PDS-S1 | GRIB Master Tables Version | 1
PDS-S1 | GRIB Local Tables Version | 0
PDS-S1 | Significance of reference time | 1 (Start of Forecast)
PDS-S1 | Reference Time | 02/15/2005 21:00:00 UTC
PDS-S1 | Operational Status | 0 (Operational products)
PDS-S1 | Type of Data | 1 (Forecast products)
PDS-S4 | Product type | 0 (Analysis at a horizontal layer at a point in time)
PDS-S4 | Category Description | 0 (Temperature)
PDS-S4 | Category Sub-Description | 0 (Temperature [K])
PDS-S4 | Output grid, (COMPUTED) english unit is | [F]
PDS-S4 | Generation process | 2 (Forecast)
PDS-S4 | Background generating process ID | 0
PDS-S4 | Forecast generating process ID | 0
PDS-S4 | Forecast time in hours | 3.000000
PDS-S4 | Type of first fixed surface | 1 (Ground or water surface [-])
PDS-S4 | Value of first fixed surface | 0.000000
GDS | Number of Points | 72225
GDS | Projection Type | 10 (Mercator)
GDS | Shape of Earth | sphere
GDS | Radius | 6371.200000 (km)
GDS | Nx (Number of points on parallel) | 321
GDS | Ny (Number of points on meridian) | 225
GDS | Lat1 | 18.066780
GDS | Lon1 | 198.374755
GDS | u/v vectors relative to | easterly/northerly
GDS | Lat2 | 23.082000
GDS | Lon2 | 206.031000
GDS | Dx | 2500.000000 (m)
GDS | Dy | 2500.000000 (m)
GDS | Input GRIB2 grid, scan mode | 64 (0100)
GDS | Output grid, scan mode | 64 (0100)
GDS | (.flt file grid), scan mode | 0 (0000)
GDS | Output grid, scan i/x direction | positive
GDS | Output grid, scan j/y direction | positive
GDS | (.flt file grid), scan j/y direction | negative
GDS | Output grid, consecutive points in | i/x direction
GDS | Output grid, adjacent rows scan in | same direction
GDS | MeshLat | 20.000000
GDS | OrientLon | 0.000000
GDS | Tangent Lat1 | 0.000000
GDS | Tangent Lat2 | 0.000000
GDS | Southern Lat | 0.000000
GDS | Southern Lon | 0.000000
Info | Packing that was used | 2 (Grid point data - complex packing)
Info | Original field type | 0 (Floating point)
Info | Missing value management | 0 (No explicit missing value included with data)
Info | Detected number of Missing | 0
Info | Field minimum value | 40.200000
Info | Field maximum value | 83.220000

I'm tried gdal version 1.2.4 and 1.2.5. My platform is Sun Solaris 2.8, GCC compiler version 3.4.2, libgeotiff version 1.2.2, and  libtiff version 3.6.1.
 
I have tried 2 different configure options, 1st time using internal libraries, 2nd time with external libraries.
 
 
Thanks,
 
Juliana Lo
Pacific Disaster Center



More information about the Gdal-dev mailing list