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

regions of inaccessibility #50

Open jwkvam opened 5 years ago

jwkvam commented 5 years ago

I'm sure this is outside the scope of this module, but I was wondering your thoughts if you wanted to weigh in.

I am interested in finding regions of inaccessibility, which I would define as all points that have a distance to the polygon close to that of the pole of inaccessibility's distance to the polygon. I think I could adapt this algorithm so that once the pole of inaccessibility is found, I could visit the cells again and prune cells which are guaranteed to not have any regions of inaccessibility, keep cells that are wholly regions of inaccessible and split cells that are in-between. Something akin to alpha beta pruning, IIRC.

For my application, points that are almost poles can be reasonable solutions. For example, like putting text on a polygon :)