Endpoints: 28,729MCP servers: 18,413Payout addresses: 2,071Paid calls: 1,537Letters: 14Defects: 1,322counted 4 min ago
teppi

Endpoint · extractionPOSTapi.geoprimitives.dev/v1/geometry/centroid

Find the area centroid of a polygon: a representative point for labelling, joining, or reverse geocoding a shape you only have a boundary for.
Read moreFind the area centroid of a polygon: a representative point for labelling, joining, or reverse geocoding a shape you only have a boundary for. It is the centre of mass of the area with holes subtracted, not the average of the vertices, so densely sampled edges do not drag it. Know what a centroid is not: on a concave or ring-shaped polygon the centre of mass can fall outside the polygon itself, and this endpoint returns it anyway rather than nudging the point inside. Test it with POST /v1/pip if you need a point that is guaranteed to be inside. Not turf's centroid, which is the arithmetic mean of the vertices and drifts towards whichever part of the boundary happens to be densely sampled. The moment integral is evaluated in a Lambert cylindrical equal-area projection of the WGS 84 authalic sphere, so the cos(latitude) area weighting is right at high latitude, then inverted back to longitude and latitude. Non-areal input, and polygons that enclose zero area, fall back to the vertex mean and say so in the method field. Input is EPSG:4326 only. Limits: 100000 positions across the whole document, 1 MiB request body.
UNRATEDDelisted

Overview

Grade?
UNRATED
0 of 30 paid calls toward a letter
Price
$0.01 per call
Paid calls
none yet
delivery unknown until someone pays

More info

URL
https://api.geoprimitives.dev/v1/geometry/centroid
Seen
first 34 days ago · last 14 days ago
51 free handshakes

Payment

Pays through
— never asked
Offered on?
— never asked
Listed on?
Base

About

?Description
Find the area centroid of a polygon: a representative point for labelling, joining, or reverse geocoding a shape you only have a boundary for. It is the centre of mass of the area with holes subtracted, not the average of the vertices, so densely sampled edges do not drag it. Know what a centroid is not: on a concave or ring-shaped polygon the centre of mass can fall outside the polygon itself, and this endpoint returns it anyway rather than nudging the point inside. Test it with POST /v1/pip if you need a point that is guaranteed to be inside. Not turf's centroid, which is the arithmetic mean of the vertices and drifts towards whichever part of the boundary happens to be densely sampled. The moment integral is evaluated in a Lambert cylindrical equal-area projection of the WGS 84 authalic sphere, so the cos(latitude) area weighting is right at high latitude, then inverted back to longitude and latitude. Non-areal input, and polygons that enclose zero area, fall back to the vertex mean and say so in the method field. Input is EPSG:4326 only. Limits: 100000 positions across the whole document, 1 MiB request body.
URL
https://api.geoprimitives.dev/v1/geometry/centroid
Method
POST
Class
extraction
?Checkable to
L1
Endpoint id
cap_01M1A59RX1FYXQ84DVHM52V1EF

?Badge

Reads live. UNRATED until paid calls earn a letter.

Markdown
[![Teppi](https://api.teppi.xyz/badge/cap_01M1A59RX1FYXQ84DVHM52V1EF.svg)](https://teppi.xyz/endpoint/cap_01M1A59RX1FYXQ84DVHM52V1EF)
HTML
<a href="https://teppi.xyz/endpoint/cap_01M1A59RX1FYXQ84DVHM52V1EF"><img src="https://api.teppi.xyz/badge/cap_01M1A59RX1FYXQ84DVHM52V1EF.svg" alt="Teppi delivery record"></a>
Image
https://api.teppi.xyz/badge/cap_01M1A59RX1FYXQ84DVHM52V1EF.svg
Verify it yourselfnpx teppi-check https://api.geoprimitives.dev/v1/geometry/centroidcurl -s https://api.teppi.xyz/v1/trust/cap_01M1A59RX1FYXQ84DVHM52V1EF