<div dir="ltr"><div><div>Hi list,<br><br></div>I have a classified raster layer and i'm trying to get de sld string, using PHP/mapscript, but $layer->generetaSLD method returns an empty SLD.<br><br></div><div>This code (works for vector layers):<br>
</div><div><br></div><div>$layer = $mapobject->getLayerByName("ImagenSatelitalbajares");<br>$layer->set('status', MS_ON);<br>echo $layer->generateSLD():<br></div><div><br></div><div>prints:<br><pre id="line1">
<span><<span>StyledLayerDescriptor</span> <span>version</span>="<a>1.0.0</a>" <span>xmlns</span>="<a>http://www.opengis.net/sld</a>" <span>xmlns:gml</span>="<a>http://www.opengis.net/gml</a>" <span>xmlns:ogc</span>="<a>http://www.opengis.net/ogc</a>" <span>xmlns:xlink</span>="<a>http://www.w3.org/1999/xlink</a>" <span>xmlns:xsi</span>="<a>http://www.w3.org/2001/XMLSchema-instance</a>" <span>xsi:schemaLocation</span>="<a>http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd</a>"></span><span>
<span id="line2"></span></span><span></<span>StyledLayerDescriptor</span>></span><span></span></pre></div><div><br></div>Layer definition:<br><br>LAYER<br> NAME "ImagenSatelitalbajares"<br> TYPE RASTER<br>
STATUS OFF<br> CLASS<br> NAME "Clase 0"<br> EXPRESSION ([pixel] >= 20 AND [pixel] < 30)<br> STYLE<br> COLOR 0 255 0<br> END<br> END<br> CLASS<br> NAME "Clase 1"<br> EXPRESSION ([pixel] >= 30 AND [pixel] < 40)<br>
STYLE<br> COLOR 0 0 255<br> END<br> END<br> CLASSITEM "[pixel]"<br> DATA "../layers/raster/BlueMarble_Argentina.img"<br> GROUP "grImagenSatelitalbajares"<br> PROCESSING "BANDS=1"<br>
PROJECTION<br> "init=epsg:900913"<br> END<br> TEMPLATE "foo.bar"<br>END<br clear="all"><div><div><div><div><br></div><div>Mapserver version is 6.0.1.<br></div><div><br></div><div>Don't know if this is a bug or I'm doing something wrong.<br>
</div><div>Thanks in advance,<br></div><div><br>-- <br>Juan Rapoport<br>SUR Emprendimientos Tecnológicos<br><br>Perú 345 Piso 5to Oficina "B" (C1067AAG)<div><br>Ciudad de Buenos Aires, Argentina<br></div>Tel. +54 (11) 4342-2976/84<br>
<a href="mailto:apc@suremptec.com.ar" target="_blank">juanrapoport@suremptec.com.ar</a><br><a href="http://www.suremptec.com/" target="_blank">www.suremptec.com</a>
</div></div></div></div></div>