[MAPSERVER-USERS] SLD not working

Bart van den Eijnden (OSGIS) bartvde at osgis.nl
Thu Feb 14 00:54:13 EST 2008


Don't use quotes around the SLD URL.

&SLD=http://10.1.15.68/sfmaps/sld/sfgis_shoreext.xml

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: Paul McCullough <Paul.McCullough at sfgov.org>
Naar: mapserver-users at lists.osgeo.org <mapserver-users at lists.osgeo.org>
Onderwerp: [MAPSERVER-USERS] SLD not working
Datum: 13/02/08 23:16

> 
> All,
> 
> I am new to map server and I cannot get an SLD to work.
> I found posts similar to mine - none helped.
> The SLD works fine in geoserver so I suspect my mapserver config (3 days
> old).
> 
> Here is my URL on one line:
>
http://10.1.15.68/cgi-bin/mapserv.exe?map=/ms4w/maps/map.map&amp;LAYERS=shore_extent&amp;UNITS=dd&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;FORMAT=image%2Fjpeg&amp;SRS=EPSG%3A4326&amp;BBOX=-122.42699980800003,37.752500096,-122.36449971200004,37.815000192&amp;WIDTH=256&amp;HEIGHT=256&amp;PROJECTION=EPSG%3A4326&amp;SLD=&quot;http://10.1.15.68/sfmaps/sld/sfgis_shoreext.xml&quot;&amp;
> 
> Here is my URL formatted nicely for your inspection:
> http://10.1.15.68/cgi-bin/mapserv.exe
> ?map=/ms4w/maps/map.map
> &amp;LAYERS=shore_extent
> &amp;UNITS=dd
> &amp;SERVICE=WMS
> &amp;VERSION=1.1.1
> &amp;REQUEST=GetMap
> &amp;STYLES=
> &amp;FORMAT=image%2Fjpeg
> &amp;SRS=EPSG%3A4326
>
&amp;BBOX=-122.42699980800003,37.752500096,-122.36449971200004,37.815000192
> &amp;WIDTH=256
> &amp;HEIGHT=256
> &amp;PROJECTION=EPSG%3A4326
> &amp;SLD=&quot;http://10.1.15.68/sfmaps/sld/sfgis_shoreext.xml&quot;
> &amp;
> 
> Here is my map file:
> MAP
>   IMAGECOLOR 180 180 250
>   IMAGETYPE PNG24
>   UNITS DD
>   WEB
>     IMAGEPATH &quot;/tmp/&quot;
>     IMAGEURL &quot;tmp/&quot;
> 	METADATA
> 	  &quot;wms_title&quot; &quot;a wms title&quot;
> 	  &quot;wms_srs&quot; &quot;EPSG:4326&quot;
> 	END
>   END
>   PROJECTION
>     &quot;init=EPSG:4326&quot;
>   END
>   LAYER
>     NAME &quot;shore_extent&quot;
>     DEBUG ON
> 	GROUP &quot;Selected&quot;
> 	CONNECTIONTYPE postgis
> 	CONNECTION &quot;user=postgres password=postgres dbname=postgis
host=localhost
> port=5432&quot;
> 	DATA &quot;the_geom from shoreext&quot;
>         TYPE POLYGON
> 	STATUS DEFAULT
>         PROJECTION
>           &quot;init=EPSG:102643&quot;
>         END
>     CLASS
>       NAME 'Shore Extent'
>       METADATA
>         &quot;wms_sld_body&quot;  &quot;AUTO&quot;
> 	  END
>           # I have tried this style section commented in and out
> 	  STYLE
> 	    OUTLINECOLOR 100 100 100
> 	    COLOR 200 200 200
> 	  END
> 	END
>   END
> END
> 
> Here is the SLD
> &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
> &lt;sld:StyledLayerDescriptor
xmlns:sld=&quot;http://www.opengis.net/sld&quot;
> xmlns:ogc=&quot;http://www.opengis.net/ogc&quot;
> xmlns:gml=&quot;http://www.opengis.net/gml&quot;
version=&quot;1.0.0&quot;&gt;
>     &lt;sld:UserLayer&gt;
>         &lt;sld:LayerFeatureConstraints&gt;
>             &lt;sld:FeatureTypeConstraint/&gt;
>         &lt;/sld:LayerFeatureConstraints&gt;
>         &lt;sld:UserStyle&gt;
>             &lt;sld:Name&gt;Default Styler&lt;/sld:Name&gt;
>             &lt;sld:Title&gt;Default Styler&lt;/sld:Title&gt;
>             &lt;sld:Abstract/&gt;
>             &lt;sld:FeatureTypeStyle&gt;
>                 &lt;sld:Name&gt;simple&lt;/sld:Name&gt;
>                 &lt;sld:Title&gt;title&lt;/sld:Title&gt;
>                 &lt;sld:Abstract&gt;abstract&lt;/sld:Abstract&gt;
>                
&lt;sld:FeatureTypeName&gt;shoreext&lt;/sld:FeatureTypeName&gt;
>                
>
&lt;sld:SemanticTypeIdentifier&gt;generic:geometry&lt;/sld:SemanticTypeIdentifier&gt;
>                 &lt;sld:Rule&gt;
>                     &lt;sld:Name&gt;name&lt;/sld:Name&gt;
>                     &lt;sld:Title&gt;title&lt;/sld:Title&gt;
>                     &lt;sld:Abstract&gt;Abstract&lt;/sld:Abstract&gt;
>                     &lt;sld:PolygonSymbolizer&gt;
>                         &lt;sld:Fill&gt;
>                             &lt;sld:CssParameter name=&quot;fill&quot;&gt;
>                                
&lt;ogc:Literal&gt;#EBE6DC&lt;/ogc:Literal&gt;
>                             &lt;/sld:CssParameter&gt;
>                             &lt;sld:CssParameter
name=&quot;fill-opacity&quot;&gt;
>                                 &lt;ogc:Literal&gt;1.0&lt;/ogc:Literal&gt;
>                             &lt;/sld:CssParameter&gt;
>                         &lt;/sld:Fill&gt;
>                     &lt;/sld:PolygonSymbolizer&gt;
>                 &lt;/sld:Rule&gt;
>             &lt;/sld:FeatureTypeStyle&gt;
>         &lt;/sld:UserStyle&gt;
>     &lt;/sld:UserLayer&gt;
> &lt;/sld:StyledLayerDescriptor&gt;
> 
> Here is my httpd.conf file:
> http://www.nabble.com/file/p15471896/httpd.conf httpd.conf 
> 
> 
> I am on
>  - windows xp sp 2.
>  - Apache 2.2 (installed separately)
>  - ms4w (cgi-bin hooked up &quot;manually&quot;)
> 
> I can get the map file style to work but not the SLD.
> I am obviously missing something.
> I would have tried, without success, to put this into the map file.
> And have read some inconclusive discussion about server side SLD.
> I have read about how mapserver does not implement all SLD idioms and
played
> around with my SLD.
> All suggestions welcome.
> 
> Regards,
> Paul
> 
> -- 
> View this message in context:
http://www.nabble.com/SLD-not-working-tp15471896p15471896.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 





More information about the mapserver-users mailing list