Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
GSIP 160 - Options for KML Placemark placement
The subject of this proposal is the addition of options for KML encoding to control the placement of placemark icons, mostly for polygons.
Assigned to Release
This proposal is for GeoServer 2.12
- Under Discussion
- In Progress
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 options would introduce three new top level format options keys.
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.
This change doesn't change any default behaviour and is purely additive so shouldn't have any backwards compatibility issues.
Project Steering Committee:
- Alessio Fabiani:
- Andrea Aime: +1
- Ben Caradoc-Davies:
- Brad Hards: +0
- Christian Mueller:
- Ian Turton: +1
- Jody Garnett: +1
- Jukka Rahkonen: +1
- Kevin Smith: +1
- Simone Giannecchini: 0