mapbox/polylabel
A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++) observed · 2026-08-28
Health v2 · maintenance only
80/100
- Activity 89
- Release rhythm 58
- Longevity 100
Flags: no_license
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3708
- days_rel: 69
- days_push: 69
- n_releases_24m: 1
Adoption not part of the score
1550 stars · 163 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A fast JavaScript (and C++) library implementing an iterative grid algorithm to find the pole of inaccessibility of a polygon — the internal point farthest from the polygon outline. It is primarily used for optimal text label placement on polygons in maps and visualizations.
Use cases
- find optimal label position inside a polygon
- compute the pole of inaccessibility of a polygon
- place map labels at the most spacious point of a region
- find the most distant internal point from a polygon outline
- calculate visual center of a polygon for annotation
- avoid label overlap by centering text in polygon interiors
When to choose
- you need guaranteed global-optimum label placement within a given precision
- you work with GeoJSON-like polygon data in JavaScript or C++
- performance matters and centroid-based placement is insufficient for concave polygons
When to avoid
- you need a polygon centroid rather than the visual center
- you need label placement for points or lines rather than polygons
- you need a full geometry library rather than a single focused algorithm
Facets
library · maturity stable
geospatial math graphics browser cross-platform cpp polygon geometry label-placement pole-of-inaccessibility computational-geometry algorithm maps geospatial algorithms nodejs
2 sources
- readme: https://github.com/mapbox/polylabel · fetched 2026-08-28 · 97aa4be0c005
- registry_npm: https://registry.npmjs.org/polylabel · fetched 2026-08-29 · 0ca6a2a327ec
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| mapbox/polylabel | main | 80 |
For agents
markdown · JSON · MCP: product_card(name="mapbox/polylabel")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem