[mapserver-users] SLD TextSymbolizer in 6.1-dev
jlundnielsen
jolni at KMS.dk
Wed Jul 25 04:31:48 PDT 2012
Thanks for your reply Julien, and sorry for taking so long to get back...
In short it did not work for me.
I have since made a simple mapfile with just a single layer from a
shapefile. It shows the labels as expected.
Then I did a GetStyles request, to let MapServer generate its own SLD based
on that. Labels are requested in this MapServer-generated SLD.
But when I then send a GetMap request applying this SLD, the labels are not
shown. Somehow the TextSymbolizer in the SLD is not translated into a label
in the temporary mapfile.
Does anyone have an idea what might be the problem here?
I have not noticed any other problems with my new install of 6.2 beta1, and
I'm not having this problem in version 6.0.1.
Below is my original LAYER from the mapfile, the MapServer-generated SLD and
finally the temporary LAYER from applying the SLD to a GetMap request.
/LAYER #kommune
NAME "kommune"
TYPE polygon
STATUS ON
DATA "KOMMUNE"
EXTENT 120000 5900000 1000000 6500000
MINSCALEDENOM 1
MAXSCALEDENOM 100000000
TEMPLATE "blank.html"
LABELITEM "KOMNAVN"
METADATA
"wms_title" "Kommune"
"wms_srs" "epsg:25832"
"ows_include_items" "all"
END #METADATA
CLASS
NAME "default"
GROUP "default"
LABEL
COLOR 40 40 173
FONT "verdana"
TYPE truetype
SIZE 12
POSITION AUTO
PARTIALS FALSE
MINDISTANCE 100
MINFEATURESIZE auto
END #LABEL
STYLE
OUTLINECOLOR 40 40 173
WIDTH 2
END #STYLE
END #CLASS
END #LAYER
<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>kommune</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<Name>default</Name>
<MinScaleDenominator>1.000000</MinScaleDenominator>
<MaxScaleDenominator>100000000.000000</MaxScaleDenominator>
<PolygonSymbolizer>
<Stroke>
<CssParameter name="stroke">#2828ad</CssParameter>
<CssParameter name="stroke-width">2.00</CssParameter>
</Stroke>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>KOMNAVN</Label>
<CssParameter name="font-family">verdana</CssParameter>
<CssParameter name="font-size">12.00</CssParameter>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name="fill">#2828ad</CssParameter>
</Fill>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
LAYER
DATA "KOMMUNE"
EXTENT 120000 5900000 1000000 6500000
LABELITEM "KOMNAVN"
MAXSCALEDENOM 1e+08
METADATA
"wms_srs" "epsg:25832"
"ows_include_items" "all"
"wms_title" "Kommune"
END # METADATA
MINSCALEDENOM 1
NAME "kommune"
STATUS ON
TEMPLATE "blank.html"
TILEITEM "location"
TYPE POLYGON
UNITS METERS
CLASS
NAME "default"
MAXSCALEDENOM 1e+08
MINSCALEDENOM 1
STYLE
ANGLE 0
OFFSET 0 0
POLAROFFSET 0 0
OUTLINECOLOR 40 40 173
END # STYLE
TEXT ("[KOMNAVN]")
END # CLASS
END # LAYER/
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/SLD-TextSymbolizer-in-6-1-dev-tp4984223p4990737.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
More information about the MapServer-users
mailing list