-
Notifications
You must be signed in to change notification settings - Fork 1
GSIP 160
The subject of this proposal is the addition of options for KML encoding to control the placement of placemark icons, mostly for polygons.
Justin Deoliveira
This proposal is for GeoServer 2.12
- Under Discussion
- In Progress
- Completed
- Rejected
- Deferred
Currently in KML output placemark icons are placed simply by using the centroid of a geometry. While this works much of the time there are instances where it is not desirable. Such as:
- A geometry is irregularly shaped (think of a "C" shaped polygon) and the centroid doesn't fall within the polygon.
- The centroid of a geometry falls outside of the request viewport, resulting in the display of a geometry without it's placemark icon.
The current patch can be found here.
The proposal is to add a new format option for kml called "kmcentroid" that would allow for controlling how the "centroid" is computed. This new option would allow for the following:
-
To use a sampling approach to finding a central point of the geometry rather than just the centroid. This is the same approach that the image renderer uses when placing labels and graphics to solve similar issues. This addresses problem 1 above.
-
To clip the geometry with the viewport before calculating the centroid. Again something the image renderer does and a solution to problem 2 above.
The syntax of the new option would introduce another level of key value pairs to specify which options to turn on, and in the case of the sampling to which degree to sample. The following is an example:
&format_options=kmcentroid:contain@true,samples@10,clip@true
Which specifies that the centroid must be contained by the geometry, to use 10 samples to derive it, and also to clip the geometry before choosing the point.
An alternative syntax would be to use additional top level format options for the parameters. Such as:
&format_options=kmcentroid_contain:true;kmcentroid_samples:10;kmcentroid_clip:true
If there is a consensus that the second syntax is better I'll happily change it.
This proposal is 100% additive, no default behaviour will be changed.
Project Steering Committee:
- Alessio Fabiani:
- Andrea Aime:
- Ben Caradoc-Davies:
- Brad Hards:
- Christian Mueller:
- Ian Turton:
- Jody Garnett:
- Jukka Rahkonen:
- Kevin Smith:
- Simone Giannecchini:
©2020 Open Source Geospatial Foundation