[mapserver-users] Mapserver + NDVI styling

Jorge Arévalo jorge.arevalo at deimos-space.com
Wed Sep 28 05:12:46 EDT 2011


I'm serving a NDVI coverage via Mapserver. So, one band, float32
values, [-1.0, 1.0]. I want to display the NDVI in greyscale, and
generate a legend. I've tried 2 things:

- Create two dummy classes, just for testing:

CLASS
    NAME "rojo"
    EXPRESSION ([pixel] < 0.3)
    STYLE
        COLOR 255 0 0
    END
END

CLASS
    NAME "azul"
    EXPRESSION ([pixel] >= 0.3)
    STYLE
        COLOR 0 0 255
    END
END

So, my legend looks like this: http://dl.dropbox.com/u/6599273/leyenda.png

And the image, obviously, is red and blue:
http://dl.dropbox.com/u/6599273/capturas/ndvi_en_gvsig.png

But I'd like to see the image in greyscale... The I've tried the next thing

- Pre-classify values with PROCESSING "SCALE=-1.0, 1.0". I don't know
what Mapserver internally does with this processing order, but I can
see the image in greyscale:
http://dl.dropbox.com/u/6599273/capturas/ndvi_gris_en_gvsig.png

The problem is now I can't see any legend, because I've not created
any class. I'd like to see all the different levels of the grayscale
image in my legend.

How could I do it?

Many thanks in advance

-- 
Jorge Arévalo
Internet & Mobility Division, DEIMOS
jorge.arevalo at deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g


More information about the mapserver-users mailing list