[Mapserver-users] Help COLOR_MATCH_THRESHOLD

Matt Doggett mdoggett at coas.oregonstate.edu
Wed May 7 18:40:17 EDT 2003


I have raster data (via GDAL) with values much larger than 255 and I
tried using the PROCESSING directive as described in this thread but I'm
not getting it to work. In fact, I can't find ANY reference to this
option in the documentation. Apparently, you got it to work, so...how
did you do it? What's the syntax and use for this option? Where is it
documented?

-Matt
(RedHat8.0, Apache2.0, Mapserver 3.6.4, Php4.2.3)

The following snippet from my mapfile:
  LAYER
    NAME "PPT"
    STATUS ON
    DATA
"/home/mistral/forages/data/grass/us/PERMANENT/cellhd/us_ppt_01"
    TYPE RASTER
    TEMPLATE "ttt.html"
    PROCESSING "SCALE=0,105812"
  END

Produces the following error:
Warning: MapServer Error in loadLayer(): (PROCESSING):(87) in
/home/mistral/forages/www/us_simple.php on line 12
Fatal error: Failed to open map file ./us.map in
/home/mistral/forages/www/us_simple.php on line 12


> -----Original Message-----
> From: mapserver-users-admin at lists.gis.umn.edu [mailto:mapserver-users-
> admin at lists.gis.umn.edu] On Behalf Of Frank Warmerdam
> Sent: Tuesday, April 22, 2003 6:56 AM
> To: Hussain, Asghar (IWMIPK)
> Cc: mapserver-users at lists.gis.umn.edu
> Subject: Re: [Mapserver-users] Help COLOR_MATCH_THRESHOLD
> 
> Hussain, Asghar (IWMIPK) wrote:
> > Dear all
> >
> > I am publishing raster data through mapserver. I wants to use GDAL
> > library how I can use in map file for example I have elevation data
the
> > values are more than 256 color. So I wants to decrease the color
depth.
> > please can any one help and share the map file code with me ?
> 
> Asghar,
> 
> I don't think you need to use COLOR_MATCH_THRESHOLD in this case.
Instead
> you
> need to scale your elevation data into the range 0-255 (or perhaps a
more
> constrained range).
> 
> By default the GDAL raster input code for MapServer will just truncate
> pixel
> values outside the range 0-255, so any elevation over 255 would be set
to
> 255.
> 
> What you need to do is establish the range of values that can occur,
and
> then
> set a SCALING processing directive to control the scaling of the raw
> raster
> values into the 0-255 range.
> 
> For instance if a utility like gdalinfo (or metadata) tells you that
the
> range of elevation is 0 to 1000 you might put the following directive
in
> the LAYER section to force the input range to be scaled down to 0-255:
> 
>   PROCESSING "SCALE=0,1000"
> 
> If you don't want to figure out the min and max for your dataset, and
> don't
> need to be able to document exactly what output values correspond to
in
> input elevations you could just use auto-scaling.
> 
>   PROCESSING "SCALE=AUTO"
> 
> Note that auto-scaling is based only on the rectangle of raster data
> loaded
> for a particular request, so the scaling applied will vary depending
on
> the
> section of data being viewed.  This is often inappropriate.
Auto-scaling
> will
> always be inappopriate if you want to produce a legend with meaningful
> range
> values for the classes.
> 
> I think that the SCALE processing option is documented in the mapfile
> reference.
> 
> 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
> 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list