If you are seeing repeated labels on a polygon with tiled: set to false, is
it possible that you actually have multiple adjacent polygons representing a
contiguous area? I am surprised to hear that GeoServer is labeling the same
polygon multiple times without repeated TextSymbolizers or any vendor
options requesting such behavior.
However, there is a vendor option that may help with your repeated labels:
http://docs.geoserver.org/stable/en/user/styling/sld-reference/labeling.html?highlight=group#grouping-geometries-vendoroption-name-group
Another trick is to use geometry transformations to label only a
representative point for each polygon:
> <TextSymbolizer>
<Geometry>
<ogc:Function name="centroid">
<ogc:PropertyName>the_geom</ogc:PropertyName>
</ogc:Function>
</Geometry>
</TextSymbolizer>
Bear in mind that the centroid does not have to lie on the polygon, so this
approach has varying success depending on your data.
Hope this helps.
--
David Winslow
OpenGeo - http://opengeo.org/
On Mon, Sep 6, 2010 at 4:14 PM, Robert Buckley <[email protected]>wrote:
> Hi,
>
> How can I limit the amount of labels per polygon to 1?
>
> I have tried setting Tiled: to false, but this doesn´t have any effect. Are
> there any other setting to avoid this?
>
> Thanks,
>
> Robert
>
> Here is my SLD part for the text
>
> <sld:TextSymbolizer>
> <sld:Label>
> <ogc:PropertyName>GNAME</ogc:PropertyName>
> </sld:Label>
> <sld:Font>
> <sld:CssParameter
> name="font-family">Arial</sld:CssParameter>
> <sld:CssParameter name="font-size">11</sld:CssParameter>
> <sld:CssParameter
> name="font-style">normal</sld:CssParameter>
> <sld:CssParameter
> name="font-weight">bold</sld:CssParameter>
> </sld:Font>
> <sld:LabelPlacement>
> <sld:PointPlacement>
> <sld:AnchorPoint>
> <sld:AnchorPointX>0.5</sld:AnchorPointX>
> <sld:AnchorPointY>0.5</sld:AnchorPointY>
> </sld:AnchorPoint>
> </sld:PointPlacement>
> </sld:LabelPlacement>
> <sld:Fill>
> <sld:CssParameter name="fill">#000000</sld:CssParameter>
> </sld:Fill>
> <sld:VendorOption name="autoWrap">180</sld:VendorOption>
> <sld:VendorOption name="spaceAround">10</sld:VendorOption>
> </sld:TextSymbolizer>
> </sld:Rule>
>
>
>
>
>
> ------------------------------------------------------------------------------
> This SF.net Dev2Dev email is sponsored by:
>
> Show off your parallel programming skills.
> Enter the Intel(R) Threading Challenge 2010.
> http://p.sf.net/sfu/intel-thread-sfd
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users