Opened 19 years ago
Closed 15 years ago
#1451 closed defect (fixed)
Getlegendgraphic with SLD is failing
Reported by: | Owned by: | assefa | |
---|---|---|---|
Priority: | high | Milestone: | FUTURE |
Component: | WMS Server | Version: | 4.6 |
Severity: | normal | Keywords: | |
Cc: | tomkralidis |
Description
Can't apply an SLD to a getlegendgraphic request. The documentation at http://mapserver.gis.umn.edu/doc46/wms-server-howto.html#getlegendgraphic says that you can do this. It's returning a blank screen. Also tried it with SLD_BODY instead of SLD and it returns a regular getlegendgraphic request but seems to ignore the SLD_BODY. http://localhost/cgi-bin/mapserv.exe?map=c:\ms4w\apps\chameleon\cesi\map\mapfile1.map&service=wms&version=1.1.1&request=getlegendgraphic&layer=pearseshape&format=image/gif&sld=http://localhost/chameleon/cesi/sldpearseshape.xml This is a polygon layer with an SLD with polygonsymbolizer as shown below. <?xml version="1.0" encoding="utf-8" standalone="no"?> <StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld" 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.opengeospatial.net/sld/1.0.0/StyledLayerDescriptor.xsd"> <Name>Pearse</Name> <Title>Pearse Drainage Areas</Title> <Abstract>Pearse Drainage Areas</Abstract> <NamedLayer> <Name>pearseshape</Name> <UserStyle> <Name>PearseStyle</Name> <Title>PearseStyle</Title> <IsDefault>1</IsDefault> <FeatureTypeStyle> <Rule> <ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>PEARSEDA</ogc:PropertyName> <ogc:Literal>Arctic Coast - Islands</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter> <PolygonSymbolizer> <Geometry> <PropertyName>the_area</PropertyName> </Geometry> <Fill> <CssParameter name="fill">#000000</CssParameter> </Fill> <Stroke> <CssParameter name="stroke">#999999</CssParameter> <CssParameter name="stroke-width">2.0</CssParameter> </Stroke> </PolygonSymbolizer> </Rule> </FeatureTypeStyle> </UserStyle> </NamedLayer> </StyledLayerDescriptor>
Change History (12)
comment:3 by , 17 years ago
Is this reproducable : using and SLD/SLDBODY with a name should give a valid legend.
comment:4 by , 17 years ago
Using trunk, I'm able to get an SLD-enabled GetLegendGraphic response with no problem:
However, trying with SLD_BODY looks like the SLD is not picked up:
http://devgeo.cciw.ca/cgi-bin/mapserv/carts?service=WMS&version=1.1.1&request=GetLegendGraphic&layer=cws&format=image/png&sld_body=<StyledLayerDescriptor%20version="1.0.0"%20xmlns="http://www.opengis.net/sld"%20xmlns:ogc="http://www.opengis.net/ogc"%20xmlns:xlink="http://www.w3.org/1999/xlink"%20xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"%20xsi:schemaLocation="http://www.opengis.net/sld%20http://schemas.opengeospatial.net/sld/1.0.0/StyledLayerDescriptor.xsd"><Name>Pearse</Name><Title>Pearse%20Drainage%20Areas</Title><Abstract>Pearse%20Drainage%20Areas</Abstract><NamedLayer><Name>cws</Name><UserStyle><Name>PearseStyle</Name><Title>PearseStyle</Title><IsDefault>1</IsDefault><FeatureTypeStyle><Rule><Name>foo</Name><PolygonSymbolizer><Geometry><PropertyName>msGeometry</PropertyName></Geometry><Fill><CssParameter%20name="fill">#FF0000</CssParameter></Fill><Stroke><CssParameter%20name="stroke">#999999</CssParameter><CssParameter%20name="stroke-width">2.0</CssParameter></Stroke></PolygonSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>
comment:5 by , 17 years ago
Assefa: is SLD_BODY being processed at all via mapwms.c? The call is there, but doesn't seem to do anything.
http://devgeo.cciw.ca/cgi-bin/mapserv/carts?service=WMS&version=1.1.1&request=GetLegendGraphic&layer=cws&format=image/png&sld_body=<StyledLayerDescriptor><Name>Pearse</Name><Title>Pearse Drainage Areas</Title><Abstract>Pearse Drainage Areas</Abstract><NamedLayer><Name>cws</Name><UserStyle><Name>PearseStyle</Name><Title>PearseStyle</Title><IsDefault>1</IsDefault><FeatureTypeStyle><Rule><Name>foo</Name><PolygonSymbolizer><Geometry><PropertyName>msGeometry</PropertyName></Geometry><Fill><CssParameter name="fill">#FF0000</CssParameter></Fill><Stroke><CssParameter name="stroke">#999999</CssParameter><CssParameter name="stroke-width">2.0</CssParameter></Stroke></PolygonSymbolizer></Rule></FeatureTypeStyle></UserStyle></NamedLayer></StyledLayerDescriptor>
comment:6 by , 17 years ago
Looks like the SLD_BODY value is being truncated and hence not being processed.
We need to 1./ throw in some better error handling across mapogcsld.c 2./ allocate more space to an SLD_BODY param
comment:7 by , 17 years ago
Milestone: | 5.0 release → FUTURE |
---|
comment:8 by , 16 years ago
Hey Tom, I am running into this one as well unfortunately with 5.0.2. Is there any quick fix that you can think of? Much appreciated.
comment:9 by , 16 years ago
Sorry I was sending the value unencoded which caused this. After using encodeURIComponent in javascript it works fine.