Polylabel.jl

Finds pole of inaccessibility for a given polygon. Based on Vladimir Agafonkin's https://github.com/mapbox/polylabel
Author asinghvi17
Popularity
3 Stars
Updated Last
7 Months Ago
Started In
January 2023

Polylabel.jl

Stable Dev Build Status

Gujarat

This package implements an algorithm to find the pole of inaccessibility of a polygon, the most distant internal point from the polygon outline. This algorithm was originally written (and taken from) mapbox/polylabel - you can find a lot more information there! To summarize, the algorithm is basically a quad-tree search across the polygon which finds the point which is most distant from any edge.

In the plot above, this point is shown in orange, while the input polygon (multipolygon in this case) is shown in blue.

The package is built on top of the GeoInterface, and is built to work with any polygons or multipolygon object which implements the GeoInterface, specifically the functions GeoInterface.contains, GeoInterface.centroid, and the geointerface_geomtype API for reverse conversion.

The main entry point is the polylabel(input; atol = nothing, rtol = 0.01) function. It returns a 2-Tuple of floats, representing the x and y coordinates of the found pole of inaccessibility.

Used By Packages

No packages found.