[mapserver-users] WMS Client and SLD

Tony Baylis tony.baylis at resexmap.com.au
Tue Dec 1 06:03:18 EST 2009


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>

-- 
Tony Baylis
Spatial Information Specialist
Resource and Exploration Mapping
Suite 8, 290 Boundary St
Spring Hill QLD 4000
Ph    3832 1600
Fax   3832 1603
Mob   0419 759 131
Email tony.baylis at resexmap.com.au
www   resexmap.com.au	



More information about the mapserver-users mailing list