[mapserver-users] WMS Client and SLD
Yewondwossen Assefa
yassefa at dmsolutions.ca
Tue Dec 1 09:28:48 PST 2009
Hi There,
The first thing would be to make sure that the server supports SLD
styling. Doing a GetCapabilities [1], It seems it does not (at least it
does not the DescribeLayer operation which would indicate that SLD is
supported). If there server indeed supports sld, I would suggest to do a
manual call first [2][3] and see if it applies the sld properly. If all
goes well you can then try it from MapServer.
Note also that there seems to be a error in your sld:
<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>STATUS</ogc:PropertyName></ogc:PropertyIsEqualTo></ogc:Filter>
should have a literal value in it, something like:
<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>STATUS</ogc:PropertyName><ogc:Literal>1</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>
Hope it helps.
regards,,
[1]:
http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer?service=WMS&Request=GetCapabilities
[2]:http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer?service=WMS&VERSION=1.1.0&Request=GetMap&Layers=56&SRS=EPSG:4326&BBOX=137.984510,-28.998470,153.534386,-10.098496&FORMAT=image/png&WIDTH=300&HEIGHT=200&STYLES=&
[3]http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer?service=WMS&VERSION=1.1.0&Request=GetMap&Layers=56&SRS=EPSG:4326&BBOX=137.984510,-28.998470,153.534386,-10.098496&FORMAT=image/png&WIDTH=300&HEIGHT=200&STYLES=&sld=http://../mysld.xml
Tony Baylis wrote:
> All,
>
> This is the first time I have tried styling external WMS data using
> SLD and cannot get the returned data/image in the desired style.
> Below is the simplified mapfile and SLD file. If anyone has any
> pointers I'd be more than grateful. Please note that the link to the
> SLD file does work with the following return: 56 APPLICATION STATUS
> #ff0000 GRANTED STATUS #ffffbe
>
> Tony
>
> Mapfile:
> #
> # Start of map file
> #
> MAP
> NAME qld_tenement
> STATUS ON
> SIZE 800 500
> EXTENT 140 -23.25 150 -17
> UNITS DD
> SHAPEPATH "/var/www/remwms/htdocs/data"
> IMAGECOLOR 192 213 255
> SYMBOLSET "/var/www/remwms/htdocs/includes/symbols.sym"
> FONTSET "/usr/share/fonts/truetype/font.list"
> DEBUG 2
> CONFIG "MS_ERRORFILE" "/var/www/ms_tmp/ms_error.txt"
>
> #IMAGETYPE PNG
>
> OUTPUTFORMAT
> NAME "AGGA"
> MIMETYPE "image/png"
> DRIVER "AGG/PNG"
> EXTENSION "png"
> IMAGEMODE RGBA
> TRANSPARENT ON
> END
>
> #
> # Start of web interface definition
> #
> WEB
> IMAGEPATH "/var/www/ms_tmp/"
> IMAGEURL "http://mapserver1/ms_tmp/"
> END
>
> #
> # Assign Projection
> #
> PROJECTION
> "init=epsg:4283"
> END
>
> LAYER
> NAME "EPM"
> TYPE RASTER
> STATUS ON
> CONNECTIONTYPE WMS
> CONNECTION
> 'http://atlas.information.qld.gov.au/ArcGIS/services/IRTM/MapServer/WMSServer?'
>
> METADATA
> "wms_srs" "EPSG:4326"
> "wms_name" "56"
> "wms_server_version" "1.1.1"
> "wms_format" "image/png"
> "wms_title" "EPM"
> "wms_include_items" "all"
> "wms_sld_url" "http://mapserver1/remwms/includes/sld/publicsld.xml"
> "wms_legend_graphic" "0"
> "wms_feature_info_mime_type" "text/plain"
> END
> END
>
> END
>
> SLD File:
> <?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
> http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd">
> <NamedLayer>
> <Name>56</Name>
> <UserStyle>
> <FeatureTypeStyle>
> <Rule>
> <Name>APPLICATION</Name>
>
> <ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>STATUS</ogc:PropertyName></ogc:PropertyIsEqualTo></ogc:Filter>
>
> <PolygonSymbolizer>
> <Fill>
> <CssParameter name="fill">#ff0000</CssParameter>
> </Fill>
> </PolygonSymbolizer>
> </Rule>
> <Rule>
> <Name>GRANTED</Name>
>
> <ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>STATUS</ogc:PropertyName></ogc:PropertyIsEqualTo></ogc:Filter>
>
> <PolygonSymbolizer>
> <Fill>
> <CssParameter name="fill">#ffffbe</CssParameter>
> </Fill>
> </PolygonSymbolizer>
> </Rule>
> </FeatureTypeStyle>
> </UserStyle>
> </NamedLayer>
> </StyledLayerDescriptor>
>
--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst
Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/
Phone: (613) 565-5056 (ext 14)
Fax: (613) 565-0925
----------------------------------------------------------------
More information about the MapServer-users
mailing list