Raster colors

Matthew Edmondson matt0177 at GMAIL.COM
Thu Oct 20 15:36:25 EDT 2005


I had a similar problem when I first started using mapserver with USGS
rasters, when I started using gdaltindex to create a index, they started
displaying normally. Here is the layer I use for some imagery I downloaded
from USGS and gdaltindex'd.
 LAYER
name tucson_arial_1
group "Arial"
type raster
TILEINDEX "../../graphics/tucson_arial_index.shp"
TILEITEM "location"
status off
METADATA
"wms_title" "Tucson Arial Photos"
"wms_srs" "EPSG:4326"
"wms_abstract" "Obtained from the USGS, Image from August-October
2002,0.3Meters,UTM, Color"
END
END
 Good Luck,
 Matt

 On 10/20/05, Chip Taylor <work at xwb.com> wrote:
>
> 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/8d3c9493/attachment.html


More information about the mapserver-users mailing list