This is not a duplicate of: how to display polygons as points until certain zoom level?
I want to do this with Geoserver v2.5.5 if possible (not openlayers).
Basically - I have a layer of polygons, which look great when zoomed in, but are nigh on impossible to see when zoomed out to a reasonable level.
I've tried using SLD to add a heavier stroke weight to the poly's, but it just looks rubbish (I get these weird looking triangles that are in no way representative of the poly). So I've come the conclusion that I'll need to display points instead when user is zoomed out.
I understand that I could just publish two layers and handle the conditional zoom logic client side - but, c'mon! Surely Geoserver should do the heavy lifting for me ;)
So bottom line - is it possible to publish a layer in Geoserver that will display points at one zoom level, and poly's at another?
EDIT:
Just to clarify: I don't need an actual point geometry, I just need to style polygon geometries to display like points at certain zoom levels.
Answer
If you style your polygon with a point symbolizer it will be displayed by a point. So all you need is two symbolizers (one point, one polygon) in a pair of rules with scale constraints on them.
EDIT:
Here's a simple SLD example:
500000
rgba(255, 255, 255, 0)
#FF4000
1
500000
circle
#FF0000
10
![]()
No comments:
Post a Comment