[Gdal-dev] ENVI and raster attributes/color support

Frank Warmerdam warmerdam at pobox.com
Tue Nov 2 15:23:39 EST 2004


Markus Neteler wrote:
> Hi,
> 
> I have written (hope I got it right) a BSQ header file
> for
> 
> http://glcf.umiacs.umd.edu/data/landcover/data.shtml
> AVHRR Global Land Cover Classification
> 
> The attached file is a header file for "gl-latlong-1km-landcover.bsq.gz" from:
> ftp://ftp.glcf.umiacs.umd.edu/glcf/Global_Land_Cover/Global/gl-latlong-1km-landcover/
> 
> My question is if support could be added to GDAL to read
> the color table and the raster attributes so that I could
> generate a more GIS convenient IMG file or whatever. 
> Or is it a complicated thing (or "quota exceeded" for me :-)?

Markus,

I have implemented support for reading the "class lookup" as a colormap for
the first band, and capturing the "class names" as category names returned
by the GDAL GetCategoryNames() method.

I doubt the class/category names will do you much good as I am unaware of any
utility other than gdalinfo that does anything with category names.

warmerda at gdal2200[523]% gdalinfo *.bsq
Driver: ENVI/ENVI .hdr Labelled
Size is 43200, 21600
Coordinate System is:
GEOGCS["WGS 84",
     DATUM["WGS_1984",
         SPHEROID["WGS 84",6378137,298.257223563,
             AUTHORITY["EPSG","7030"]],
         TOWGS84[0,0,0,0,0,0,0],
         AUTHORITY["EPSG","6326"]],
     PRIMEM["Greenwich",0,
         AUTHORITY["EPSG","8901"]],
     UNIT["degree",0.0174532925199433,
         AUTHORITY["EPSG","9108"]],
     AXIS["Lat",NORTH],
     AXIS["Long",EAST],
     AUTHORITY["EPSG","4326"]]
Origin = (-180.000000,90.000000)
Pixel Size = (0.00833333,-0.00833333)
Corner Coordinates:
Upper Left  (-180.0000000,  90.0000000) (180d 0'0.00"W, 90d 0'0.00"N)
Lower Left  (-180.0000000, -90.0000000) (180d 0'0.00"W, 90d 0'0.00"S)
Upper Right ( 180.0000000,  90.0000000) (180d 0'0.00"E, 90d 0'0.00"N)
Lower Right ( 180.0000000, -90.0000000) (180d 0'0.00"E, 90d 0'0.00"S)
Center      (  -0.0000000,   0.0000000) (  0d 0'0.00"W,  0d 0'0.00"N)
Band 1 Block=43200x1 Type=Byte, ColorInterp=Palette
   Description = global land cover file 1km
   Categories:
       0: Water_and_Goode_s_interrupted_space
       1: Evergreen_Needleleaf_Forest
       2: Evergreen_Broadleaf_Forest
       3: Deciduous_Needleleaf_Forest
       4: Deciduous_Broadleaf_Forest
       5: Mixed_Forest
       6: Woodland
       7: Wooded_Grassland
       8: Closed_Shrubland
       9: Open_Shrubland
      10: Grassland
      11: Cropland
      12: Bare_Ground
      13: Urban_and_Built-up
   Color Table (RGB with 14 entries)
     0: 0,0,0,255
     1: 1,100,0,255
     2: 1,130,0,255
     3: 151,191,71,255
     4: 2,220,0,255
     5: 0,255,0,255
     6: 146,174,47,255
     7: 220,206,0,255
     8: 255,173,0,255
     9: 255,251,195,255
    10: 140,72,9,255
    11: 247,165,255,255
    12: 255,199,174,255
    13: 0,255,255,255

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list