Using SLD with GetLegendGraphic

Bart van den Eijnden (OSGIS) bartvde at XS4ALL.NL
Fri Mar 3 00:17:34 PST 2006


Hi,

this should be possible, I have done it in the past but with SLD_BODY 
and the SLD inline in the HTTP GET request. Are you able to give that a 
try? But do check your webserver access logs to see that the full 
request is getting to Mapserver when using the SLD_BODY option.

Also, which Mapserver version are you trying this on?

Best regards,
Bart

Miles Jordan wrote:

>Hi List,
>
>Is it possible to make a getLegendGraphic request, using a SLD to define
>the style?
>
>I'm using the same SLD in a getMap request, which styles the layers
>appropriately, as I am for a getLegendGraphic request, which shows
>nothing. If I don't use the SLD, or use a different value in the <Name>
>element of <NamedLayer>, the default style is shown in the
>LegendGraphic.
>
>I'm only just starrting to look at mapserver, so I might be missing
>something simple.
>
>This is the request I'm using: 
>http://myserver/cgi-bin/mapserv.exe?map=/ms4w/apps/layers/service/sample
>_collection.map&service=WMS&REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMA
>T=image/png&WIDTH=50&HEIGHT=50&LAYER=Humpback_whale_migration&SLD=http:/
>/myserver/test.sld
>
>
>The SLD:
><?xml version="1.0" encoding="UTF-8"?>
><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
>StyledLayerDescriptor.xsd">
>
><NamedLayer>
>	<Name>Humpback_whale_migration</Name>
>	<UserStyle>
>		<Title>Humpback Whale Migration</Title>
>		<FeatureTypeStyle>
>			<Rule>
>				<LineSymbolizer>
>					<Geometry>
>	
><ogc:PropertyName>GEOMETRY</ogc:PropertyName>
>					</Geometry>
>					<Stroke>
>						<CssParameter
>name="stroke">#000000</CssParameter>
>						<CssParameter
>name="stroke-opacity">1</CssParameter>
>						<CssParameter
>name="stroke-width">2</CssParameter>
>						<CssParameter
>name="stroke-linejoin">Round</CssParameter>
>						<CssParameter
>name="stroke-linecap">Square</CssParameter>
>						<CssParameter
>name="stroke-dasharray">2.0 4.0 4.0 4.0</CssParameter>
>						<CssParameter
>name="stroke-dashoffset">0</CssParameter>
>					</Stroke>
>				</LineSymbolizer>
>			</Rule>
>		</FeatureTypeStyle>
>	</UserStyle>
></NamedLayer>
>
></StyledLayerDescriptor>
>
>
>I'd appreciate any help anyone can offer, thanks.
>
>
>Miles Jordan
>Applications Developer
>The Australian Antarctic Data Centre
>
>[p] +61 3 6232 3486
>[f] +61 3 6232 3359
>[e] miles.jordan at aad.gov.au
>[w] http://www.aad.gov.au/
>___________________________________________________________________________
>
>    Australian Antarctic Division - Commonwealth of Australia
>IMPORTANT: This transmission is intended for the addressee only. If you are not the
>intended recipient, you are notified that use or dissemination of this communication is
>strictly prohibited by Commonwealth law. If you have received this transmission in error,
>please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
>DELETE the message.
>        Visit our web site at http://www.aad.gov.au/
>___________________________________________________________________________
>
>
>
>  
>


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



More information about the MapServer-users mailing list