[mapserver-users] Trouble shooting SLD?

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Mon Oct 18 10:16:11 EDT 2010


Hi,

SLD takes an URL to a complete SLD document with headers while with SLD_BODY the body part of SLD document is written URL-encoded directly into the GetMap request string.

I noticed that none of the full request links in the document http://mapserver.org/ogc/sld.html are working now, for example 

http://demo.mapserver.org/cgi-bin/wms?http://demo.mapserver.org/cgi-bin/wms?SERVICE=wms&VERSION=1.1.1&REQUEST=GetMap&LAYERS=country_bounds&FORMAT=png&WIDTH=400&HEIGHT=300&SRS=EPSG:4326&STYLES=&BBOX=-180.0,-90.0,180.0,90.0&TRANSPARENT=TRUE&SLD=http://demo.mapserver.org/ogc-demos/map/sld/sld_line_one_filter.xml

However, the SLD can be found with browser. I think that it proves that remote SLDs do not always work as supposed. 

These examples with SLD_BODY worked a minute ago:
http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=1059&HEIGHT=687&LAYERS=sea,borders,maxspeed_query&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=-574187,6558020,1615375,7978444&SRS=EPSG:3067&STYLES=&maxspeed=100&SLD_BODY=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3CStyledLayerDescriptor+version%3D%221.0.0%22%3E%3CNamedLayer%3E%3CName%3Emaxspeed_query%3C%2FName%3E%3CUserStyle%3E%3CFeatureTypeStyle%3E%3CRule%3E%3CLineSymbolizer%3E%3CStroke%3E%3CCssParameter+name%3D%22stroke%22%3E%23E6550D%3C%2FCssParameter%3E%3CCssParameter+name%3D%22stroke-opacity%22%3E1.00%3C%2FCssParameter%3E%3CCssParameter+name%3D%22stroke-width%22%3E1.00%3C%2FCssParameter%3E%3C%2FStroke%3E%3C%2FLineSymbolizer%3E%3C%2FRule%3E%3C%2FFeatureTypeStyle%3E%3C%2FUserStyle%3E%3C%2FNamedLayer%3E%3C%2FStyledLayerDescriptor%3E

http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=1059&HEIGHT=687&LAYERS=sea,borders,maxspeed_query&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=-574187,6558020,1615375,7978444&SRS=EPSG:3067&STYLES=&maxspeed=100&SLD_BODY=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%3CStyledLayerDescriptor+version%3D%221.0.0%22%3E%3CNamedLayer%3E%3CName%3Emaxspeed_query%3C%2FName%3E%3CUserStyle%3E%3CFeatureTypeStyle%3E%3CRule%3E%3CLineSymbolizer%3E%3CStroke%3E%3CCssParameter+name%3D%22stroke%22%3E%2331A354%3C%2FCssParameter%3E%3CCssParameter+name%3D%22stroke-opacity%22%3E1.00%3C%2FCssParameter%3E%3CCssParameter+name%3D%22stroke-width%22%3E2.00%3C%2FCssParameter%3E%3C%2FStroke%3E%3C%2FLineSymbolizer%3E%3C%2FRule%3E%3C%2FFeatureTypeStyle%3E%3C%2FUserStyle%3E%3C%2FNamedLayer%3E%3C%2FStyledLayerDescriptor%3E

Get the style with GetStyles:

http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetStyles&SERVICE=WMS&VERSION=1.1.1&layers=maxspeed_query

-Jukka Rahkonen-

> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta K
> Lähetetty: 18. lokakuuta 2010 16:57
> Vastaanottaja: Bartłomiej Burkot
> Kopio: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] Trouble shooting SLD?
> 
> I wasnt using SLD_BODY, just the the URL to the SLD document, 
> using the 
> SLD tag. Would there be a difference in using SLD_BODY and it is 
> something I should try?
> 
> Thanks,
> 
> Ken
> 
> On 18/10/2010 6:15 AM, Bartłomiej Burkot wrote:
> >   Hi
> >
> > if you use SLD_BODY in Your url parameter in wms getmap 
> request try to
> > replace all '#' characters to '%23'
> > example:
> > 
> http://yourhost/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&B
> BOX=6411762.591659,5756575.612084,6416330.414387,5758975.58427
> 9&CRS=EPSG:your_epsg&WIDTH=1102&HEIGHT=580&LAYERS=your_layer&F
ORMAT=image/gif&DPI=96> &TRANSPARENT=TRUE&SLD_BODY=<StyledLayerDescriptor
> > version="1.0.0" xmlns=*MailScanner has detected a possible 
> fraud attempt
> > from "www.opengis.net" claiming to be* "http://www.opengis.net/sld"
> > xmlns:gml=*MailScanner has detected a possible fraud attempt from
> > "www.opengis.net" claiming to be* "http://www.opengis.net/gml"
> > xmlns:ogc=*MailScanner has detected a possible fraud attempt from
> > "www.opengis.net" claiming to be* "http://www.opengis.net/ogc"
> > xmlns:xlink=*MailScanner has detected a possible fraud attempt from
> > "www.w3.org" claiming to be* "http://www.w3.org/1999/xlink"
> > xmlns:xsi=*MailScanner has detected a possible fraud attempt from
> > "www.w3.org" claiming to be* 
> "http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation=*MailScanner has detected a possible 
> fraud attempt
> > from "www.opengis.net" claiming to be* "http://www.opengis.net/sld
> > 
> http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd
> "><NamedLayer><Name>your_layer</Name><UserStyle><FeatureTypeSt
yle><Rule><PolygonSymbolizer></PolygonSymbolizer><PolygonSymbolizer>> <Stroke><CssParameter
> > name="stroke">*%23ff00ff*</CssParameter><CssParameter
> > 
> name="stroke-width">3.00</CssParameter></Stroke></PolygonSymbo
lizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLay> erDescriptor>
> >
> > Bartek
> >
> >
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> 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