Raster colors

Chip Taylor work at XWB.COM
Thu Oct 20 15:28:32 EDT 2005


I downloaded some landsat raster images from the USGS site for use in a
mapserver application.  In ArcMap the colors are fine.  Here is the layer I
have in MapServer:

LAYER
     NAME "landcover"
     DATA "cover/81802474/81802474.tif"
     STATUS on
     TYPE RASTER
     PROCESSING "BANDS=3" 
     PROCESSING "DITHER=YES"
END

The layer comes out grayscaled on the map.  If I include a classitem as
described in the "Raster- HowTo" document like this:

CLASSITEM "[pixel]"
  # class using simple string comparison, equivelent to ([pixel] = 0)
  CLASS
    EXPRESSION "0"
    COLOR 0 0 0
  END
  # class using an EXPRESSION using only [pixel]. 
  CLASS
    EXPRESSION ([pixel] >= 64 AND [pixel] < 128)
    COLOR 255 0 0 
  END
  # class using the red/green/blue values from the palette
  CLASS
    NAME "near white"
    EXPRESSION ([red] > 200 AND [green] > 200 AND [blue] > 200)
    COLOR 0 255 0 
  END
  # Class using a regular expression to capture only pixel values ending in
1
  CLASS
    EXPRESSION /*1/
    COLOR 0 0 255
  END

Then I get a bunch of red, green, and blue pixels.

What's the secret to displaying these raster files in their true colors?

Chip Taylor
Prepared Response, Inc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20051020/bdbea7a4/attachment.html


More information about the mapserver-users mailing list