[Mapserver-users] SLD and mapserver...

Kralidis,Tom [Burlington] Tom.Kralidis at ec.gc.ca
Thu Jul 1 22:51:09 EDT 2004


This is a multi-part message in MIME format.

------_=_NextPart_001_01C45FDF.6DA8A342
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable



> -----Original Message-----
> From: mapserver-users-admin at lists.gis.umn.edu=20
> [mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of=20
> William White
> Sent: Thursday, July 01, 2004 5:02 PM
> To: mapserver-users at lists.gis.umn.edu
> Subject: [Mapserver-users] SLD and mapserver...
>=20
>=20
> Hello mapserver enthusiasts,
>=20
> I am interested in displaying a very simple world political map on my=20
> global financial markets page=20
> (http://www.zenfinder.com/finance/globalMarkets.php).  I=20
> would like to=20
> fill specific countries with different colours based upon the=20
> percentage=20
> change of that country's major securities index.
>  From what I can gather - I should be able to do this pretty easily=20
> using SLD, assuming I can find a server with a world politcal=20
> map which=20
> supports SLD for that particular layer.
>=20
> I found a world political map that appears to have SLD enabled:
>=20
> http://www2.dmsolutions.ca/cgi-bin/mswms_world?SERVICE=3DWMS&VeR
> sIoN=3D1.1.1&Request=3DGetMap&LAYERS=3DWorldPolitical=20
>=20
>=20
> but when I pass in my XML doc (see below) it doesn't appear to be=20
> working.  My syntax may be incorrect or potentially this=20
> server does not=20
> accept this type of SLD?  I am assuming if I download the mapserver=20
> software, I should be able to render the desired map on my=20
> home computer=20
> but I would much prefer to be able to leverage an existing server.=20

Very good choice!

> Since my requirements are quite simple (I just need to be=20
> able to colour=20
> a world map) - I am hoping there is an existing server which I can=20
> reference and simply pass in the various style descriptors (of the=20
> countries that need to be filled in) via the querystring or=20
> an xml doc=20
> referenced in the querystring.
>=20
> Does anyone know of a server that would allow me to do this/what I'm=20
> doing wrong with this one?  Any guidance or advice regarding this or=20
> perhaps a simpler solution would be extremely appreciated!!!
>=20

A couple of issues:

- you don't need the 'sld:' prefix in your XML elements.  The default
namespace of the SLD document should be the same as xmlns:sld
- you don't need to put quotes around the Literal values

I've attached a file which works with this WMS if you pass, along with
your GetMap request:

"SLD=3D<urlOfSldDocument>"


> Thanks in advance.
>=20
> William.
>=20
> This is the xml doc I'm currently passing in as an SLD.
> <?xml version=3D"1.0" encoding=3D"UTF-8"?>=20
> <sld:StyledLayerDescriptor version=3D"1.0.0"=20
> xmlns:sld=3D"http://www.opengis.net/sld"=20
> xmlns:ogc=3D"http://www.opengis.net/ogc"=20
> xmlns:gml=3D"http://www.opengis.net/gml"=20
> xmlns:xsi=3D"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=3D"fill">#FF0000</sld:CssParameter>
> <sld:CssParameter name=3D"fill-opacity">1.0</sld:CssParameter>
> </sld:Fill>
> <sld:Stroke>
> <sld:CssParameter name=3D"stroke">#FF0000</sld:CssParameter>
> <sld:CssParameter name=3D"stroke-opacity">1.0</sld:CssParameter>
> <sld:CssParameter name=3D"stroke-width">1</sld:CssParameter>
> <sld:CssParameter name=3D"stroke-linecap">butt</sld:CssParameter>
> </sld:Stroke>
> </sld:PolygonSymbolizer>
> </sld:Rule>
> </sld:FeatureTypeStyle>
> </sld:UserStyle>
> </sld:NamedLayer>
> </sld:StyledLayerDescriptor>
>=20
>=20
>=20
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu=20
> http://lists.gis.umn.edu/mailman/listinfo/maps> erver-users
>=20

------_=_NextPart_001_01C45FDF.6DA8A342
Content-Type: application/octet-stream;
	name="world_filter.sld"
Content-Transfer-Encoding: base64
Content-Description: world_filter.sld
Content-Disposition: attachment;
	filename="world_filter.sld"

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxTdHlsZWRMYXllckRlc2Ny
aXB0b3IgdmVyc2lvbj0iMS4wLjAiIHhtbG5zPSJodHRwOi8vd3d3Lm9wZW5naXMubmV0L3NsZCIg
eG1sbnM6b2djPSJodHRwOi8vd3d3Lm9wZW5naXMubmV0L29nYyIgeG1sbnM6eGxpbms9Imh0dHA6
Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAw
MS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL3d3dy5vcGVu
Z2lzLm5ldC9zbGQgaHR0cDovL3NjaGVtYXMub3Blbmdpcy5uZXQvc2xkLzEuMC4wL1N0eWxlZExh
eWVyRGVzY3JpcHRvci54c2QiPg0KICAgICAgICA8TmFtZWRMYXllcj4NCiAgICAgICAgICAgICAg
ICA8TmFtZT5Xb3JsZFBvbGl0aWNhbDwvTmFtZT4NCiAgICAgICAgICAgICAgICA8VXNlclN0eWxl
Pg0KICAgICAgICAgICAgICAgICAgICAgICAgPE5hbWU+U3R5bGVOYW1lMTwvTmFtZT4NCiAgICAg
ICAgICAgICAgICAgICAgICAgIDxGZWF0dXJlVHlwZVN0eWxlPg0KICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICA8UnVsZT4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICA8b2djOkZpbHRlcj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgIDxvZ2M6T3I+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIDxvZ2M6UHJvcGVydHlJc0VxdWFsVG8+DQogICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9nYzpQ
cm9wZXJ0eU5hbWU+TkFNRTwvb2djOlByb3BlcnR5TmFtZT4NCiAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b2djOkxpdGVyYWw+
QnJhemlsPC9vZ2M6TGl0ZXJhbD4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgPC9vZ2M6UHJvcGVydHlJc0VxdWFsVG8+DQogICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvZ2M6UHJvcGVy
dHlJc0VxdWFsVG8+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgPG9nYzpQcm9wZXJ0eU5hbWU+TkFNRTwvb2djOlByb3BlcnR5
TmFtZT4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICA8b2djOkxpdGVyYWw+Q2FuYWRhPC9vZ2M6TGl0ZXJhbD4NCiAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9vZ2M6UHJv
cGVydHlJc0VxdWFsVG8+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICA8L29nYzpPcj4NCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICA8L29nYzpGaWx0ZXI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
PFBvbHlnb25TeW1ib2xpemVyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgPEZpbGw+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgIDxDc3NQYXJhbWV0ZXIgbmFtZT0iZmlsbCI+I0ZGMDAwMDwvQ3Nz
UGFyYW1ldGVyPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICA8Q3NzUGFyYW1ldGVyIG5hbWU9ImZpbGwtb3BhY2l0eSI+MS4wPC9Dc3NQYXJh
bWV0ZXI+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8
L0ZpbGw+DQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8
U3Ryb2tlPg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICA8Q3NzUGFyYW1ldGVyIG5hbWU9InN0cm9rZSI+I0ZGMDAwMDwvQ3NzUGFyYW1ldGVy
Pg0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICA8Q3NzUGFyYW1ldGVyIG5hbWU9InN0cm9rZS1vcGFjaXR5Ij4xLjA8L0Nzc1BhcmFtZXRlcj4N
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
PENzc1BhcmFtZXRlciBuYW1lPSJzdHJva2Utd2lkdGgiPjE8L0Nzc1BhcmFtZXRlcj4NCiAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPENzc1Bh
cmFtZXRlciBuYW1lPSJzdHJva2UtbGluZWNhcCI+YnV0dDwvQ3NzUGFyYW1ldGVyPg0KICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9TdHJva2U+DQogICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9Qb2x5Z29uU3ltYm9saXplcj4N
CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC9SdWxlPg0KICAgICAgICAgICAgICAg
ICAgICAgICAgPC9GZWF0dXJlVHlwZVN0eWxlPg0KICAgICAgICAgICAgICAgIDwvVXNlclN0eWxl
Pg0KICAgICAgICA8L05hbWVkTGF5ZXI+DQo8L1N0eWxlZExheWVyRGVzY3JpcHRvcj4=

------_=_NextPart_001_01C45FDF.6DA8A342--



More information about the mapserver-users mailing list