andrewharvey / geojson-polygon-labels

Command line tool to generate point labels from GeoJSON polygons
ISC License
82 stars 16 forks source link

How to achieve original label placement? #28

Closed xeruf closed 2 months ago

xeruf commented 2 years ago

explode:

image

combine:

image

neither matches the original label location exactly, can I achieve that? because I thought mapbox/polylabel is the original algorithm of the native OSM style?

andrewharvey commented 2 years ago

Looks like they are using PostGIS ST_PointOnSurface, I haven't looked into which algorithm they use.

andrewharvey commented 2 months ago

I recently added support for turf point on polygon, but it doesn't look like the same algorithm as ST_PointOnSurface, not sure if there's much we can do about this, so I'll close for now. If you have any suggestions please feel free to reopen.