I'm not sure but if you just display your raster without any styling i think MapSever would show it in grayscale.<br><br>I'm new with MapServer so i'm feeling a bit insolent posting a reply :)<br><br><br><div class="gmail_quote">
El 28 de septiembre de 2011 11:30, Jorge Arévalo <span dir="ltr"><<a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a>></span> escribió:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/9/28 Jorge Arévalo <<a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a>>:<br>
<div><div></div><div class="h5">> I'm serving a NDVI coverage via Mapserver. So, one band, float32<br>
> values, [-1.0, 1.0]. I want to display the NDVI in greyscale, and<br>
> generate a legend. I've tried 2 things:<br>
><br>
> - Create two dummy classes, just for testing:<br>
><br>
> CLASS<br>
>    NAME "rojo"<br>
>    EXPRESSION ([pixel] < 0.3)<br>
>    STYLE<br>
>        COLOR 255 0 0<br>
>    END<br>
> END<br>
><br>
> CLASS<br>
>    NAME "azul"<br>
>    EXPRESSION ([pixel] >= 0.3)<br>
>    STYLE<br>
>        COLOR 0 0 255<br>
>    END<br>
> END<br>
><br>
> So, my legend looks like this: <a href="http://dl.dropbox.com/u/6599273/leyenda.png" target="_blank">http://dl.dropbox.com/u/6599273/leyenda.png</a><br>
><br>
> And the image, obviously, is red and blue:<br>
> <a href="http://dl.dropbox.com/u/6599273/capturas/ndvi_en_gvsig.png" target="_blank">http://dl.dropbox.com/u/6599273/capturas/ndvi_en_gvsig.png</a><br>
><br>
> But I'd like to see the image in greyscale... The I've tried the next thing<br>
><br>
> - Pre-classify values with PROCESSING "SCALE=-1.0, 1.0". I don't know<br>
> what Mapserver internally does with this processing order, but I can<br>
> see the image in greyscale:<br>
> <a href="http://dl.dropbox.com/u/6599273/capturas/ndvi_gris_en_gvsig.png" target="_blank">http://dl.dropbox.com/u/6599273/capturas/ndvi_gris_en_gvsig.png</a><br>
><br>
> The problem is now I can't see any legend, because I've not created<br>
> any class. I'd like to see all the different levels of the grayscale<br>
> image in my legend.<br>
><br>
> How could I do it?<br>
><br>
> Many thanks in advance<br>
><br>
> --<br>
> Jorge Arévalo<br>
> Internet & Mobility Division, DEIMOS<br>
> <a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a><br>
> <a href="http://es.linkedin.com/in/jorgearevalo80" target="_blank">http://es.linkedin.com/in/jorgearevalo80</a><br>
> <a href="http://mobility.grupodeimos.com/" target="_blank">http://mobility.grupodeimos.com/</a><br>
> <a href="http://gis4free.wordpress.com" target="_blank">http://gis4free.wordpress.com</a><br>
> <a href="http://geohash.org/ezjqgrgzz0g" target="_blank">http://geohash.org/ezjqgrgzz0g</a><br>
><br>
<br>
</div></div>Ok, I've found a way, but I'm sure it isn't the shortest path.<br>
<br>
Basically, I've generated a legend using GRASS (r.colors to add grey<br>
color as color interpretation for band and d.legend to generate the<br>
legend). The legend is generated from the ndvi file. So, I guess I can<br>
create a HTML template as Mapserver legend, using the legend generated<br>
by grass (here:<br>
<a href="http://dl.dropbox.com/u/6599273/grass/grass_legend.png" target="_blank">http://dl.dropbox.com/u/6599273/grass/grass_legend.png</a>)<br>
<br>
On the other hand, I know how to generate a legend in Mapserver using<br>
CLASS objects in the mapfile, but I don't know how to generate that<br>
legend without the CLASS options in the mapfile.<br>
<br>
Am I taking the long way on this? Is there an easier way to generate a<br>
legend for a NDVI file in Mapserver?<br>
<div><div></div><div class="h5"><br>
Many thanks in advance<br>
<br>
--<br>
Jorge Arévalo<br>
Internet & Mobility Division, DEIMOS<br>
<a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a><br>
<a href="http://es.linkedin.com/in/jorgearevalo80" target="_blank">http://es.linkedin.com/in/jorgearevalo80</a><br>
<a href="http://mobility.grupodeimos.com/" target="_blank">http://mobility.grupodeimos.com/</a><br>
<a href="http://gis4free.wordpress.com" target="_blank">http://gis4free.wordpress.com</a><br>
<a href="http://geohash.org/ezjqgrgzz0g" target="_blank">http://geohash.org/ezjqgrgzz0g</a><br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br>