[mapserver-users] Classifying Rasters

Frank Warmerdam warmerdam at pobox.com
Wed Jun 27 19:07:02 PDT 2001


Folks, 

Earlier this month there was a discussion of how to classify rasters.  I am
trying the suggestions with the current MapServer in CVS but I have had
problems.  After stepping through the code I have come to the following
assumptions:

 o the CLASSITEM declaration is still required, but the passed argument
   is ignored. 

 o The CLASS EXPRESSION statements must used "[pixel]" for the value, not
   "[VALUE]" as previously suggested.  Note that not even "[PIXEL]" will work

The following is an example of a goofy classification of a raster that works.

LAYER
  NAME "JacksonvilleNC_CIB"
  DATA "jacksonville.tif"
  TYPE RASTER
  STATUS ON
  # METADATA object
  METADATA
   "wms_title" "10meter CIB"
   "wms_extent" "-78 34 -77 35"
   "wms_resx" "0.000090"
   "wms_resy" "0.000090"
  END

  CLASSITEM "junk"
  CLASS
    EXPRESSION ([pixel] < 64)
    COLOR 0 0 0
  END
  CLASS
    EXPRESSION ([pixel] > 64 AND [pixel] < 128)
    COLOR 255 0 0 
  END
  CLASS
    EXPRESSION ([pixel] > 128 AND [pixel] < 196)
    COLOR 0 255 0 
  END
  CLASS
    EXPRESSION ([pixel] > 196 AND [pixel] < 256)
    COLOR 0 0 255
  END
END

Note that all this relates to 3.5 code base in CVS.  I don't know how things
worked in 3.4.  I am writing this up as part of a raster howto targetted
at 3.5.   If my assumptions are wrong please correct me.   I would like to
suggest that the CLASSITEM not be required for raster layers. 

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 MapServer-users mailing list