[Mapserver-users] SLD and mapserver...
William White
william at javamonkeys.co.uk
Thu Jul 1 14:01:53 PDT 2004
Hello mapserver enthusiasts,
I am interested in displaying a very simple world political map on my
global financial markets page
(http://www.zenfinder.com/finance/globalMarkets.php). I would like to
fill specific countries with different colours based upon the percentage
change of that country's major securities index.
From what I can gather - I should be able to do this pretty easily
using SLD, assuming I can find a server with a world politcal map which
supports SLD for that particular layer.
I found a world political map that appears to have SLD enabled:
http://www2.dmsolutions.ca/cgi-bin/mswms_world?SERVICE=WMS&VeRsIoN=1.1.1&Request=GetMap&LAYERS=WorldPolitical
but when I pass in my XML doc (see below) it doesn't appear to be
working. My syntax may be incorrect or potentially this server does not
accept this type of SLD? I am assuming if I download the mapserver
software, I should be able to render the desired map on my home computer
but I would much prefer to be able to leverage an existing server.
Since my requirements are quite simple (I just need to be able to colour
a world map) - I am hoping there is an existing server which I can
reference and simply pass in the various style descriptors (of the
countries that need to be filled in) via the querystring or an xml doc
referenced in the querystring.
Does anyone know of a server that would allow me to do this/what I'm
doing wrong with this one? Any guidance or advice regarding this or
perhaps a simpler solution would be extremely appreciated!!!
Thanks in advance.
William.
This is the xml doc I'm currently passing in as an SLD.
<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor version="1.0.0"
xmlns:sld="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<sld:NamedLayer>
<sld:Name>WorldPolitical</sld:Name>
<sld:UserStyle>
<sld:Name>StyleName1</sld:Name>
<sld:FeatureTypeStyle>
<sld:Rule>
<ogc:Filter>
<ogc:Or>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>NAME</ogc:PropertyName>
<ogc:Literal>'Brazil'</ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>NAME</ogc:PropertyName>
<ogc:Literal>'Canada'</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Or>
</ogc:Filter>
<sld:PolygonSymbolizer>
<sld:Fill>
<sld:CssParameter name="fill">#FF0000</sld:CssParameter>
<sld:CssParameter name="fill-opacity">1.0</sld:CssParameter>
</sld:Fill>
<sld:Stroke>
<sld:CssParameter name="stroke">#FF0000</sld:CssParameter>
<sld:CssParameter name="stroke-opacity">1.0</sld:CssParameter>
<sld:CssParameter name="stroke-width">1</sld:CssParameter>
<sld:CssParameter name="stroke-linecap">butt</sld:CssParameter>
</sld:Stroke>
</sld:PolygonSymbolizer>
</sld:Rule>
</sld:FeatureTypeStyle>
</sld:UserStyle>
</sld:NamedLayer>
</sld:StyledLayerDescriptor>
More information about the MapServer-users
mailing list