[mapserver-users] generateSLD on raster layer returns an empty SLD

Juan Rapoport juanrapoport at suremptec.com.ar
Fri Feb 1 07:33:40 PST 2013


Hi list,

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.

This code (works for vector layers):

$layer = $mapobject->getLayerByName("ImagenSatelitalbajares");
$layer->set('status', MS_ON);
echo $layer->generateSLD():

prints:

<StyledLayerDescriptor version="1.0.0"
xmlns="http://www.opengis.net/sld"
xmlns:gml="http://www.opengis.net/gml"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd"></StyledLayerDescriptor>


Layer definition:

LAYER
  NAME "ImagenSatelitalbajares"
  TYPE RASTER
  STATUS OFF
  CLASS
    NAME "Clase 0"
    EXPRESSION ([pixel] >= 20 AND [pixel] < 30)
    STYLE
      COLOR 0 255 0
    END
  END
  CLASS
    NAME "Clase 1"
    EXPRESSION ([pixel] >= 30 AND [pixel] < 40)
    STYLE
      COLOR 0 0 255
    END
  END
  CLASSITEM "[pixel]"
  DATA "../layers/raster/BlueMarble_Argentina.img"
  GROUP "grImagenSatelitalbajares"
  PROCESSING "BANDS=1"
  PROJECTION
    "init=epsg:900913"
  END
  TEMPLATE "foo.bar"
END

Mapserver version is 6.0.1.

Don't know if this is a bug or I'm doing something wrong.
Thanks in advance,

-- 
Juan Rapoport
SUR Emprendimientos Tecnológicos

Perú 345  Piso 5to Oficina "B" (C1067AAG)

Ciudad de Buenos Aires, Argentina
Tel. +54 (11) 4342-2976/84
juanrapoport at suremptec.com.ar <apc at suremptec.com.ar>
www.suremptec.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130201/eb99d731/attachment.htm>


More information about the MapServer-users mailing list