1

Currently I'm developing a Web-GIS app where I use GeoServer 2.61 and OpenLayers 2. The map data is served from PostgreSQL+PostGIS via GeoServer (WMS).

I'm having a problem when I'm viewing polygon map. Some maps have a very little polygon feature, which do not show at certain zoom level when I zoom out (because the feature will be too small). Is there any workaround to prevent this to happen? I need to see ALL the polygon features at the lowest zoom level.

  • How do you expect to see those polygons? For example if you have polygon of fields, and you are looking at the entire country, what do you want to see on the screen? – Devdatta Tengshe Apr 28 '15 at 11:33
  • @DevdattaTengshe I think a point would make sense. Just found another idea of using SLD at the answer below. – ariespranata Apr 28 '15 at 12:03
3

Polygon layers by default do not stay the same size when zooming further out because they represent an area. The only aspect that you will see for smaller polygons when zoomed out is just the outline. If you still want to represent the feature when zoomed far out one option would be to add a <PointSymbolizer> within the sld that will turn on at x scale (defining MIN and MAX scales for the polygon and point symbolizers). Refer to this Q/A for how to set this up:

Use SLD to conditionally display points or polygons based on zoom level?

  • Thanks @artwork21, yeah that makes sense. However, filtering with MIN/MAX scale would also be a problem because let's say I have 2 polygon features, one is very small and the other is large. I want to keep the larger one displayed as a polygon while the smaller one displayed as a point at the same zoom level. Is that possible? – ariespranata Apr 28 '15 at 12:07
  • Got the idea about the filtering based on geometry area: docs.geoserver.org/2.6.x/en/user/styling/sld-reference/… I'll combine that with the MIN/MAX scale. Thanks for shedding some light @artwork21 – ariespranata Apr 28 '15 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.