[mapserver-users] Trouble shooting SLD?

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Sun Oct 17 16:03:32 EDT 2010


Hi,

This is a plain guess, but do you have an attribute named "Communities" in your data as it is used in
<PropertyName>Communities</PropertyName>?

-Jukka-


-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: K
Lähetetty: su 17.10.2010 21:37
Vastaanottaja: Rahkonen Jukka
Kopio: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Trouble shooting SLD?
 
Ok, didnt want to spam the the list, here is my map file and the SLD 
file I am using:

MAP
   NAME "Communities"
   SIZE 700 500
   UNITS meters
   CONFIG PROJ_LIB "R:\proj\nad\"
   CONFIG  MS_ERRORFILE "mapserver.log"
   DEBUG 5
   EXTENT -12726256 6595213 -12674715 6655243

   PROJECTION
     "init=epsg:900913"
   END
   TRANSPARENT ON
   IMAGECOLOR 255 255 255
   IMAGEQUALITY 95
   IMAGETYPE png
   OUTPUTFORMAT
     NAME png
     DRIVER 'GD/PNG'
     MIMETYPE 'image/png'
     #IMAGEMODE PC256
     EXTENSION 'png'
   END
   LEGEND
     IMAGECOLOR 255 255 255
     STATUS ON
     KEYSIZE 18 12
     LABEL
       TYPE BITMAP
       SIZE MEDIUM
       COLOR 0 0 89
     END
   END
   WEB
     IMAGEPATH 'R:/webtemp/'
     IMAGEURL '/webtemp/'

     # WMS server settings
     METADATA
       'wms_title'           '"Communities"'
       'wms_onlineresource' 
'http://someserver.com/cgi-bin/mapserv?map=wms.map&'
       'wms_srs'             'EPSG:900913'
     END
   END

   LAYER
     NAME 'Communities'
     TYPE POLYGON
     DATA 'someshapefile.shp'
     TEMPLATE 'ttt_query.html'
     DUMP TRUE
     METADATA
       'wms_title' 'Communities'
       'wms_include_items' 'ID'
     END
     STATUS DEFAULT
     CLASS
        NAME 'Communities'
        STYLE
          SYMBOL 'circle'
          SIZE 3
          OUTLINECOLOR 255 255 0
        END
     END
   END

   SYMBOL
     NAME 'circle'
     TYPE ELLIPSE
     FILLED TRUE
     POINTS 1 1 END
   END
END

And the SLD file:

<StyledLayerDescriptor version="1.0.0">
<NamedLayer>
<Name>Communities</Name>
<UserStyle>
<Title>Communities</Title>
<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Geometry>
<PropertyName>Communities</PropertyName>
</Geometry>
<Fill>
<CssParameter name="fill">#ff0000</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#ff0000</CssParameter>
<CssParameter name="stroke-width">2.0</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>

Thanks for your help,

Ken

On 17/10/2010 3:16 PM, Rahkonen Jukka wrote:
> Hi,
>
> It would be much easier to start thinking about what goes wrong if you could mail also your layer and the failing SLD.
>
> -Jukka Rahkonen-
>
>
> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org puolesta: K
> Lähetetty: su 17.10.2010 21:09
> Vastaanottaja: Jeff McKenna
> Kopio: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] Trouble shooting SLD?
>
> Thanks, I tried one of those. Left colors as is, but changed the Name,
> Title and PropertyName fields to the name of the layer in my map file.
>
> Still no luck, just returns the normal map.
>
> Thanks again,
>
> Ken
>
> On 17/10/2010 11:57 AM, Jeff McKenna wrote:
>> On 10-10-17 11:01 AM, K wrote:
>>> Is there any way to trouble shoot why an SLD layer is being being
>>> rejected, or suggestions as to what it might be? Currently Mapserver
>>> seems to be ignoring the SLD and not displaying it, which I assume means
>>> some kind of parsing error or rejection of the SLD?
>>>
>>> I look at my getcapabilities and it says:<UserDefinedSymbolization
>>> SupportSLD="1" UserLayer="0" UserStyle="1" RemoteWFS="0"/>
>>>
>>> Which I assume means yes SLD is supported.
>>>
>>> I can browse to my SLD file, no errors opening it:
>>> http://www.rockies.ca/coyotes/sld_template2.xml
>>>
>>> I have tried using an SLD created by QGIS, one using PHP/Mapscript, and
>>> a couple from examples in Mapserver documentation that I edited to work
>>> for my use.
>>>
>>> I turned on the error log in my map file and put debug to 5, no mention
>>> of any errors or anything, though that isn't surprising as from what I
>>> read Mapserver currently catches those errors and displays the WMS layer
>>> as is, but provides no feedback as to the errors?
>>>
>>> I had spaces in my layer name to start, thought that might cause a
>>> problem so removed those.
>>>
>>> I have tried viewing in Openlayers, straight URL request, and via a
>>> quick mapscript application, all the same result.
>>>
>>> Any other suggestions?
>>
>> Note that all SLDs used in the MapServer documentation can be accessed
>> at: http://demo.mapserver.org/ogc-demos/map/sld/
>>
>> -jeff
>>
>>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list