[mapserver-users] Trouble coloring a raster

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue Mar 5 12:07:39 PST 2013


I'm not sure I would recommend doing this on-the-fly in an app, but:

- add to your layer: CLASSITEM "[pixel]"
- add to your class: EXPRESSION ([pixel] >= 0)

My source: http://www.mapserver.org/input/raster.html

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 13-03-05 3:53 PM, Bistrais, Bob wrote:
> I have a geotiff raster which represents forested lands.  I’d like it to
> display in green.  I put in a Style section and specified a color, but
> try as I might, it always displays in grayscale.  It is an 8-bit
> unsigned TIFF file.
> 
>  
> 
> Below is the layer specification:
> 
>  
> 
> LAYER
> 
>   NAME "ForestLands"
> 
>   GROUP "ForestLands"
> 
>   TYPE RASTER
> 
>   STATUS on
> 
>   DATA "/mapserver_data/StreamBarriers/forestland06.tif"
> 
>  
> 
>   METADATA
> 
>     "wms_srs"                      "EPSG:4326 EPSG:26919 EPSG:26983
> EPSG:26984 EPSG:102113"
> 
>     "wms_name"                                "ForestLands"
> 
>     "wms_server_version" "1.1.1"
> 
>     "wms_format"              "image/png"
> 
>   END
> 
>  
> 
>   CLASS
> 
>     NAME "Forest"
> 
>     STYLE
> 
>         COLOR 0 250 0
> 
>     END
> 
>   END
> 
>  
> 
> END
> 
> 




More information about the mapserver-users mailing list