[mapserver-users] Trouble shooting SLD?

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue Oct 19 18:32:51 EDT 2010


Hi Ken,

See Assefa's last message to you, he made some great points.  In fact I 
hit many of the points that Assefa mentioned when fixing those 
demo.mapserver.org examples.

-jeff



On 10-10-19 5:44 PM, K wrote:
> Thanks again for your assistance.
>
> The SLD file I was using was from the mapserver repository that Jeff
> posted earlier in the thread. I went ahead and edited it and removed all
> the differing bits from yours. No change, still not reading the SLD file.
>
> I then decided to create a line file, in case the issue was polygons,
> and use the SLD file you posted, with the only change being the name,
> still not working.
>
> I went through and changed all the names to be different, then tried
> matching the SLD name with different parts in the odd hope it would
> work, again no luck.
>
> No matter what I do it seems the SLD is being ignored.
>
> Ken
>
> On 19/10/2010 3:52 AM, Rahkonen Jukka wrote:
>>
>> Hi,
>>
>> I have never made a single SLD file myself, just edited something
>> working that I have found so unfortunately I fear I cannot give very
>> good advice. I did, however, compare something that works for me and
>> your SLD file and these are the differences:
>>
>> My first line has more elements:
>> <StyledLayerDescriptor version="1.0.0"
>> xmlns="http://www.opengis.net/sld"
>> xmlns:gml="http://www.opengis.net/gml"
>> 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">
>>
>> You have Title, I don't. Hard to believe this is critical, though
>> <Title>Communities</Title>
>>
>> Then you are giving the geometry element as
>>
>> <Geometry>
>> <PropertyName>Communities</PropertyName>
>> </Geometry>
>>
>> I do not have that element at all. Mapserver documentation says that it
>> is not supported and I also believe that now it is wrong in your SLD. I
>> understand that your SLD is trying to telll now that the geometry of
>> your layer is stored in a field named "Communities". By the way, it
>> might be better to use different names in various places instead of
>> "Communities" everywhere at least when testing.
>>
>> Geoserver folks have made a SLD cookbook
>> http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html
>> it is probably worth reading.
>>
>> And here is the SLD that I looked at when doing comparison. I took it
>> out from my working Mapserver layer with GetStyles. Perhaps you could
>> try the same, style your layer to look good by editing the mapfile and
>> take the SLD out with GetStyles and you should have a good template in
>> your hands.
>>
>>
>> <StyledLayerDescriptor version="1.0.0"
>> xmlns="http://www.opengis.net/sld"
>> xmlns:gml="http://www.opengis.net/gml"
>> 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>maxspeed_query</Name>
>> <UserStyle>
>> <FeatureTypeStyle>
>> <Rule>
>> <LineSymbolizer>
>> <Stroke>
>> <CssParameter name="stroke">#ff0000</CssParameter>
>> <CssParameter name="stroke-opacity">1.00</CssParameter>
>> <CssParameter name="stroke-width">3.00</CssParameter>
>> </Stroke>
>> </LineSymbolizer>
>> </Rule>
>> </FeatureTypeStyle>
>> </UserStyle>
>> </NamedLayer>
>> </StyledLayerDescriptor>
>>
>> -Jukka Rahkonen-
>>
>>
>> K wrote
>>
>>> As I am still unable to get my SLD to work, I wonder if the
>>> shape file
>>> (is it a shape file?) and map file for that example is available to
>>> download somewhere? This way I can toss it on my server and
>>> it would let
>>> me see if my problem is software related, rather then something wrong
>>> with my files.
>>>
>>> Thanks,
>>>
>>> Ken
>>>
>>> On 18/10/2010 5:31 PM, Jeff McKenna wrote:
>>>> On 10-10-18 11:16 AM, Rahkonen Jukka wrote:
>>>>> I noticed that none of the full request links in the document
>>>>> http://mapserver.org/ogc/sld.html are working now
>>>>
>>>> Good catch Jukka. The examples should be working again,
>>> please re-try.
>>>>
>>>> -jeff
>>>>
>


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




More information about the mapserver-users mailing list