Hello,

I would like to export a mapfile to sld using the following PHP/MapScript.

function ms_create_sld($map) {
 for($i=0;$i<$map->numlayers;$i++) {
   // - get Layer
   $layer = $map->getLayer($i);
// generate the sld for that layer
   $SLD = $layer->generateSLD();

   // save sld to a file
   $fp = fopen("sld/merano/".$layer->name."-sld.xml", "w+");
   fputs($fp, $SLD);
   fclose($fp);
 }
}

Unfortunately it seems that OUTLINECOLOR is not exported, see following mapfile-fragment. It seems that this happens only with POINT Layers.
I'm using MapServer 5.0.3 on Centos5. Is there something I am doing wrong?

Regards Daniel

LAYER
 NAME "tree"
 GROUP "basic_map"
 STATUS ON
 CONNECTIONTYPE postgis
 CONNECTION "user=foo password=foo dbname=foo host=foo"
 DATA "the_geom FROM tree.tree_view USING UNIQUE tr_id USING SRID 32632"
 TYPE POINT
 DUMP TRUE  ## REQUIRED for WFS
 MINSCALE 0
##  MAXSCALE 50000
 FILTER "tr_date_end >= now() or tr_date_end is null"
 PROJECTION
   "init=epsg:32632"   ##required   per WFS
 END
 HEADER "/data/sites/wms/templates/header.html"
 TEMPLATE "/data/sites/wms/templates/test.html"
 FOOTER "/data/sites/wms/templates/footer.html"
 CLASS
   NAME "IT:Pianta|DE:Pflanze"
   SYMBOL 'circle'
   COLOR 0 200 0
*    OUTLINECOLOR 0 100 0 # THIS IS NOT EXPORTED TO SLD*
   SIZE 5
 END
 METADATA
   "DESCRIPTION" "IT:Pianta|DE:Baum"
   "WMS_SRS" "EPSG:32632"
   "WMS_TITLE" "tree_pg"
   "wms_feature_info_mime_type" "text/html"
   "wfs_title"    "tree" ## REQUIRED
   "gml_featureid" "ID" ## REQUIRED
"gml_include_items" "tr_id,<text it="ar_name_1" de="ar_name_2">,tr_code,<text it="sc_name_1" de="sc_name_2">,tr_date_start,tr_diameter_trunk" ## Optional (serves all attributes for layer)
   "wms_sld_url" "http://192.168.0.18/wms/sld/merano/tree.sld";
 END #METADATA
END #LAYER



--
 Daniel Degasperi
 Software Developer
 [EMAIL PROTECTED]
---------------------------
 R3 GIS Srl
 Via Johann Kravogl 2
 I-39010 Merano - Sinigo (BZ)
 Tel. +39 0473 494949
 Fax. +39 0473 069902
 Web  http://www.r3-gis.com
-----------------------------

<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://ogc.dmsolutions.ca/sld/1.0.0/StyledLayerDescriptor.xsd";>
<NamedLayer>
<Name>tree</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Name>IT:Pianta|DE:Pflanze</Name>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
    <CssParameter name="fill">#00c800</CssParameter>
</Fill>
<Stroke>
    <CssParameter name="stroke">#006400</CssParameter>
    <CssParameter name="stroke-width">2.0</CssParameter>
</Stroke>
</Mark>
<Size>5</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to