[mapserver-users] Styling a mapfile with SLD?

paalkr pal.kristensen at statkart.no
Tue Jun 1 10:56:09 EDT 2010


Hi all!

I'm trying to sett up a MapService that uses OGC SLD to override the regular
MapServer rendering rules (classes and styles). For some reason MapServer
does not seem to pick up the SLD, because the resulting map uses the default
drawing rules defined in the map-file rather then the SLD.

And BTW, is it possible to assign a SLD to a layer internally in a map-file,
or do I need to provide the SLD as a parameter in the WMS GetMap request?

The layer in the mapfile looks like this:

  LAYER
    NAME "PolbndA"
    TYPE POLYGON
	#TYPE LINE
    STATUS OFF
	DEBUG 5
    MAXSCALEDENOM 1900000
      CONNECTIONTYPE postgis
      CONNECTION "host=xx port=5432 dbname=xx password=xx user=xx"
      DATA "shape from euroerm.polbnda USING UNIQUE objectid USING
SRID=4326"
      PROCESSING "CLOSE_CONNECTION=DEFER"	
    METADATA
      "wms_title"             "Administrativie area"
      "wms_extent"            "-15 28 47 82"
      #"wms_sld_url" "http://www.geonorge.no/styles/erm/erm_ms_22_ah.xml"
      #"wms_sld_body" "AUTO" 
    END
    PROJECTION
      "init=epsg:4326"
    END

    #LABELITEM "f_code"
	CLASSITEM "f_code"

    CLASS
      NAME "F_CODE"
      STYLE
        OUTLINECOLOR 255 100 0
        SIZE 2
      END
      LABEL
        COLOR 0 0 0
        FONT verdana
        TYPE TRUETYPE
        SIZE 10
        PARTIALS false
        POSITION lc
      END
    END
  END

The corresponding SLD document that I try to apply:

<?xml version="1.0" encoding="utf-8"?>

  
  
    PolbndA
    
      erm:Style1
      Default Styler
      
        
        PolbndA
        title
        abstract
        
        
          Administrative Area
          Administrative Area
          
            
              f_code
              FA001
            
          
          
            
              #FFFFE6
              1
            
          
        
      
    
  


-----

Regards,
Pål Kristensen
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Styling-a-mapfile-with-SLD-tp5126372p5126372.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100601/68917d64/attachment.html


More information about the mapserver-users mailing list