I&#39;m not sure but if you just display your raster without any styling i think MapSever would show it in grayscale.<br><br>I&#39;m new with MapServer so i&#39;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">&lt;<a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a>&gt;</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 &lt;<a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; I&#39;m serving a NDVI coverage via Mapserver. So, one band, float32<br>
&gt; values, [-1.0, 1.0]. I want to display the NDVI in greyscale, and<br>
&gt; generate a legend. I&#39;ve tried 2 things:<br>
&gt;<br>
&gt; - Create two dummy classes, just for testing:<br>
&gt;<br>
&gt; CLASS<br>
&gt;    NAME &quot;rojo&quot;<br>
&gt;    EXPRESSION ([pixel] &lt; 0.3)<br>
&gt;    STYLE<br>
&gt;        COLOR 255 0 0<br>
&gt;    END<br>
&gt; END<br>
&gt;<br>
&gt; CLASS<br>
&gt;    NAME &quot;azul&quot;<br>
&gt;    EXPRESSION ([pixel] &gt;= 0.3)<br>
&gt;    STYLE<br>
&gt;        COLOR 0 0 255<br>
&gt;    END<br>
&gt; END<br>
&gt;<br>
&gt; 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>
&gt;<br>
&gt; And the image, obviously, is red and blue:<br>
&gt; <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>
&gt;<br>
&gt; But I&#39;d like to see the image in greyscale... The I&#39;ve tried the next thing<br>
&gt;<br>
&gt; - Pre-classify values with PROCESSING &quot;SCALE=-1.0, 1.0&quot;. I don&#39;t know<br>
&gt; what Mapserver internally does with this processing order, but I can<br>
&gt; see the image in greyscale:<br>
&gt; <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>
&gt;<br>
&gt; The problem is now I can&#39;t see any legend, because I&#39;ve not created<br>
&gt; any class. I&#39;d like to see all the different levels of the grayscale<br>
&gt; image in my legend.<br>
&gt;<br>
&gt; How could I do it?<br>
&gt;<br>
&gt; Many thanks in advance<br>
&gt;<br>
&gt; --<br>
&gt; Jorge Arévalo<br>
&gt; Internet &amp; Mobility Division, DEIMOS<br>
&gt; <a href="mailto:jorge.arevalo@deimos-space.com">jorge.arevalo@deimos-space.com</a><br>
&gt; <a href="http://es.linkedin.com/in/jorgearevalo80" target="_blank">http://es.linkedin.com/in/jorgearevalo80</a><br>
&gt; <a href="http://mobility.grupodeimos.com/" target="_blank">http://mobility.grupodeimos.com/</a><br>
&gt; <a href="http://gis4free.wordpress.com" target="_blank">http://gis4free.wordpress.com</a><br>
&gt; <a href="http://geohash.org/ezjqgrgzz0g" target="_blank">http://geohash.org/ezjqgrgzz0g</a><br>
&gt;<br>
<br>
</div></div>Ok, I&#39;ve found a way, but I&#39;m sure it isn&#39;t the shortest path.<br>
<br>
Basically, I&#39;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&#39;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 &amp; 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>