GSIP 160

Justin Deoliveira edited this page Jul 11, 2017 · 12 revisions

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.

Proposed By

Justin Deoliveira

Assigned to Release

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:

  1. A geometry is irregularly shaped (think of a "C" shaped polygon) and the centroid doesn't fall within the polygon.
  2. 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:

  1. 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.

  2. 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.

Backwards Compatibility

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


Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.