mapbox / polylabel

A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)
Other
1.44k stars 151 forks source link

Coords wrong with complex L shape #55

Closed iomturner closed 4 years ago

iomturner commented 4 years ago

Seems the coords generated from polylabel are wrong for this L shape

https://stackblitz.com/edit/mapbox-simple-map-q8vjbb?file=index.ts

mourner commented 4 years ago

Not wrong, you're just using a tolerance value that's too big. Changing to polylabel([coords], 0.00001) places the dot in the correct position.