[mapserver-users] Re: Mapserver + NDVI styling

Gustavo gus.fava at gmail.com
Wed Sep 28 12:19:38 EDT 2011


I'm not sure but if you just display your raster without any styling i think
MapSever would show it in grayscale.

I'm new with MapServer so i'm feeling a bit insolent posting a reply :)


El 28 de septiembre de 2011 11:30, Jorge Arévalo <
jorge.arevalo at deimos-space.com> escribió:

> 2011/9/28 Jorge Arévalo <jorge.arevalo at deimos-space.com>:
> > 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
> >
>
> Ok, I've found a way, but I'm sure it isn't the shortest path.
>
> Basically, I've generated a legend using GRASS (r.colors to add grey
> color as color interpretation for band and d.legend to generate the
> legend). The legend is generated from the ndvi file. So, I guess I can
> create a HTML template as Mapserver legend, using the legend generated
> by grass (here:
> http://dl.dropbox.com/u/6599273/grass/grass_legend.png)
>
> On the other hand, I know how to generate a legend in Mapserver using
> CLASS objects in the mapfile, but I don't know how to generate that
> legend without the CLASS options in the mapfile.
>
> Am I taking the long way on this? Is there an easier way to generate a
> legend for a NDVI file in Mapserver?
>
> 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
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110928/5c30a470/attachment.html


More information about the mapserver-users mailing list