shortbread-tiles / shortbread-docs

Documentation of the Shortbread vector tile schema
https://shortbread-tiles.org
Creative Commons Zero v1.0 Universal
25 stars 7 forks source link

Don't specify centroid as the only way to turn an area to a point #34

Closed pnorman closed 2 weeks ago

pnorman commented 6 months ago

Different implementations may prefer different ways of turning polygons into points, and this lets them experiment with new ways. Additionally, the centroid is a particularly bad algorithm as it may lay outside the polygon.

westnordost commented 6 months ago

The centroid algorithm is subpar because the centroid of e.g. a C-shaped area would be outside the area.

Mapbox once implemented an algorithm better fit for such a use case called polylabel (https://github.com/mapbox/polylabel), there are various ports to different languages, some are mentioned in the readme.

pnorman commented 6 months ago

Yes, pole of inaccessibility is a popular choice, but I don't think we should dictate the algorithm.

Nakaner commented 6 months ago

The specification currently specifies centroids because that was the only algorithm to turn polygons into points supported by Tilemaker back then (there is a second option since Tilemaker 3.0).

joto commented 5 months ago

I agree that we should make this change. It is very unlikely to break anybodies styles and from @Nakaner s comment it i clear that there was never any intention to force centroids, so this is basically just an editorial change clearing up the meaning of the text.

pnorman commented 3 weeks ago

I've fixed the merge conflicts. Can another steering committee member review and merge this?