Feature request: n-band raster layer classification

Frank Warmerdam warmerdam at POBOX.COM
Tue Feb 7 10:50:39 EST 2006


On 2/7/06, Vincent Schut <schut at sarvision.nl> wrote:
> Hello mapserver-developers,
>
> In the near future, we are going to need raster layer classes based on
> more than just the first band of a raster layer. 'We' means the small
> company I'm working for, SarVision (www.sarvision.nl). We mainly develop
> automated systems for tropical forest monitoring using satellite imagery
> from several sensors, optical as well as radar. Besides that we offer
> our customers/partners webgis access to the results through mapserver
> and a dedicated webgis client.
>
> One of our partners would like to be able to show a layer which is
> actually a combination of 2 or more raster layers. As an example: show
> all pixels that have an altitude of more than 500m or that are steeper
> than 20 degrees in red, the rest in green. Now this is still one of the
> simpler examples, and one of the prerequisites is that the
> classification values (500m and 20degrees) are dynamically adjustable by
> the user. I've been thinking of several workarounds for this, but of
> course the most suitable way would be to implement raster classes based
> on [band1], [band2], etc. instead of [pixel]. However, I'm afraid I
> don't have the skills to implement this.
>
> Could someone who is more knowledgeable on mapserver hacking elaborate a
> bit on the feasibility of this enhancement? Would it be fairly trivial
> to implement this, or almost impossible? Depending on our partner's
> budget (which we don't know yet) we might even be able to sponsor the
> implementation of this enhancement.

Vincent,

I will say that doing this will require a substantially different
approach from the current raster classification logic.  The current
logic creates a "lookup table" for input raster values, classifies
the lookup table, and then applies that lookup to the real raster
values since the current expression handling code is rather slow
to evaluate for each pixel.

Depending on your needs, I would suggest implementing some
sort of raster expressions as part of the GDAL VRT mechanism
or perhaps even do the operates as a pre-processing step (invoked
from mapscript) before mapping a resultant file.

If you really want to do it directly in MapServer and you aren't
too performance sensitive, I imagine we could come up with
something.

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-dev mailing list