# mapbox/polylabel

A fast algorithm for finding the pole of inaccessibility of a polygon (in JavaScript and C++)

Repository: https://github.com/mapbox/polylabel
Canonical: https://ross.abutalabs.com/products/polylabel
Language: JavaScript
License: NOASSERTION
License Family: other
Last push: 2026-06-25T10:36:23+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 89, release rhythm 58, longevity 100
- inputs: {"age_days": 3708, "days_push": 69, "days_rel": 69, "gap_med": null, "n_releases_24m": 1}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1550, forks 163 (observed 2026-08-28T04:05:02.143946+00:00)

## What it is
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
- artifact type: library
- maturity: stable
- function: geospatial, math
- domain: graphics
- platform: browser, cross-platform, cpp
- tags: polygon, geometry, label-placement, pole-of-inaccessibility, computational-geometry, algorithm, maps, geospatial, algorithms, nodejs

## Member repositories
- mapbox/polylabel (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:02.143946+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:30:19.601065+00:00, confidence not recorded.
  - readme: https://github.com/mapbox/polylabel (fetched 2026-08-28T04:05:02.143946+00:00, sha 97aa4be0c005)
  - registry_npm: https://registry.npmjs.org/polylabel (fetched 2026-08-29T11:31:13.005603+00:00, sha 0ca6a2a327ec)
- Data as of 2026-08-30T08:39:29.467469+00:00.
