Discussion:
[Geoserver-users] SLD grouping labels on a polygon
Pedro Mendes
2008-06-03 13:26:10 UTC
Permalink
Im having some issues getting the label of a polygon in the expected place,
the centroid.

wheres one of my slds rules
...

<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#d1d1d1 </CssParameter>
<CssParameter name="fill-opacity">0.5</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#FFa850</CssParameter>
<CssParameter name="stroke-width">1.5</CssParameter>
</Stroke>
</PolygonSymbolizer>

<TextSymbolizer>
<Label>
<ogc:PropertyName>CODE</ogc:PropertyName>
</Label>

<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-style">Normal</CssParameter>
<CssParameter name="font-size">16</CssParameter>

<Halo>
<Radius>
<ogc:Literal>2</ogc:Literal>
</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
<CssParameter name="fill-opacity">0.85</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#FFa850</CssParameter>
</Fill>

</TextSymbolizer>
...

with this i´m getting the label repeated all over the polygon.
also tried <VendorOption name="group">yes</VendorOption> or <VendorOption
name="group">true</VendorOption> at the end of <TextSymbolizer> but with no
results.

The funny thing is that if i put a pointsymbolizer, it is appearing in the
centroid of the polygon..

Can someone help?

Thanks in advance.

Pedro Mendes
--
View this message in context: http://www.nabble.com/SLD-grouping-labels-on-a-polygon-tp17623472p17623472.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Mike Pumphrey
2008-06-03 16:38:50 UTC
Permalink
Hi Pedro. I've had luck with the spaceAround parameter in the past,
which might be helpful in this case.

<VendorOption name="spaceAround"></VendorOption>
Andrea Aime
2008-06-04 12:22:18 UTC
Permalink
Pedro Mendes ha scritto:
...
Post by Pedro Mendes
with this i´m getting the label repeated all over the polygon.
also tried <VendorOption name="group">yes</VendorOption> or <VendorOption
name="group">true</VendorOption> at the end of <TextSymbolizer> but with no
results.
The funny thing is that if i put a pointsymbolizer, it is appearing in the
centroid of the polygon..
Can someone help?
Hum, are you using tiled rendering? GeoServer does not put multiple
labels per polygon usually, there are two exceptions:
* multipolygons, each one of the polygons in a multipolygon gets
labelled
* tiled rendering on the client side. If the polygon spans multiple
tiles, each tile may have its own label. This is because each tile
is a separate request, and GeoServer labels the portion of the
polygon that falls into it.
In this case you should look into metatiling, either by using
the GeoServer built it mechanism
(http://geoserver.org/display/GEOSDOC/WMS+vendor+parameters, see
"on the fly meta tiler") or by using a tile cache such as GeoWebCache
(that can be used as GeoServer plugin as well) or TileCache.

Cheers
Andrea
Pedro Mendes
2008-12-12 12:28:37 UTC
Permalink
Sorry for late reply...

Yes, i´m using tiled rendering with TileCache. Geometries are multipolygons.
I did some tests requesting tiles with OpenLayers and the output was the
expected, meaning no duplicate labels.

Metatiling is set to true and metasize to 5. I regenerated cache for the
testing bounding box and the output was the expected.

p.s.: Must refer this about MetaTiling: i'm experiecing some failed
requested tiles when the metasize value is diferent of 1,1..

Thanks list, aaime

Cumps,Pedro
Post by Andrea Aime
...
Post by Pedro Mendes
with this i´m getting the label repeated all over the polygon.
also tried <VendorOption name="group">yes</VendorOption> or <VendorOption
name="group">true</VendorOption> at the end of <TextSymbolizer> but with no
results.
The funny thing is that if i put a pointsymbolizer, it is appearing in the
centroid of the polygon..
Can someone help?
Hum, are you using tiled rendering? GeoServer does not put multiple
* multipolygons, each one of the polygons in a multipolygon gets
labelled
* tiled rendering on the client side. If the polygon spans multiple
tiles, each tile may have its own label. This is because each tile
is a separate request, and GeoServer labels the portion of the
polygon that falls into it.
In this case you should look into metatiling, either by using
the GeoServer built it mechanism
(http://geoserver.org/display/GEOSDOC/WMS+vendor+parameters, see
"on the fly meta tiler") or by using a tile cache such as GeoWebCache
(that can be used as GeoServer plugin as well) or TileCache.
Cheers
Andrea
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Geoserver-users mailing list
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
View this message in context: http://www.nabble.com/SLD-grouping-labels-on-a-polygon-tp17623472p20974757.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Loading...