maplibre / maplibre/spatial-k

Measurement - polylabel / pole of inaccessibility

Open
#321 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
141
Forks
22
Avg merge
2d 7h
Merged PRs (30d)
5

Description

Not implemented yet are `centroid` and `centerOfMass`. #5, #6

The algorithm that Mapbox / MapLibre uses internally to place labels, is however none of the above, but the pole of inaccessibility. The reason why one would want to use that at all is that for certain concave polygons (e.g. a "C"-shaped one), both `centroid` and `centerOfMass` would actually lie outside the polygon.

This [C++ library polylabel](https://github.com/mapbox/polylabel ) implements this algorithm. Maybe spatial-k would be a good home for a port of that to Kotlin.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Mapbox polylabel C++ library and the related centroid and centerOfMass issues (#5 and #6) to understand how this proposal fits spatial-k. The work is complete when the pole-of-inaccessibility algorithm has a Kotlin implementation suitable for the library.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.