Point in polygon check, plus bounding box, centroid and area for GeoJSON
Point in polygon check and GeoJSON geometry: point-in-polygon with correct hole handling, bounding box, centroid, signed area in square metres, perimeter length, and ring winding order for a geometry supplied in the request. Accepts Polygon and MultiPolygon, and a GeoJSON Feature wrapping either. Area and length are geodesic on the WGS-84 ellipsoid, correct at any latitude; containment is planar in lon/lat.
Output (data): contains (boolean|null), on_boundary (boolean|null), bbox [minLon, minLat, maxLon, maxLat], centroid {lat, lon}, area_m2, perimeter_m, winding (cw|ccw per ring, exterior first then holes, in polygon order), rings, vertices (closing point excluded). area_m2 is the WGS-84 geodesic area, signed per RFC 7946 (exterior counter-clockwise = positive, clockwise = negative, holes subtract); perimeter_m sums every ring. Point-in-polygon and centroid are planar in lon/lat; a point on an edge is contained with on_boundary:true. With ops, only the listed fields (plus rings and vertices) are returned. Rings must be closed with at least 4 positions.
Deterministic: identical input returns identical output, so the response is served with Cache-Control: private, max-age=31536000, immutable (the paying client may cache it indefinitely; shared caches must not, because the response is paid).
Price: $0.05 USDC per call (x402, Base). Route contract version 1.0.0. Docs: https://api.duoleads.com/docs#geo-polygon
Request
- Base URL: https://api.duoleads.com
- URL: https://api.duoleads.com/v1/geo/polygon
- Auth: none declared
Query parameters
URL-encoded GeoJSON Polygon, MultiPolygon or a Feature wrapping one. At most 3072 characters and 2000 coordinate pairs. Accepted: valid GeoJSON.
Point latitude; with lon, runs the containment test. Accepted: a number between -90 and 90.
Point longitude; with lat, runs the containment test. Accepted: a number between -180 and 180.
Comma-separated subset of contains,bbox,centroid,area,perimeter,winding. Default all. Accepted: comma-separated subset of contains, bbox, centroid, area, perimeter, winding.
Response
Paid and settled. data is route-specific; a route that judges its input returns 200 with data.valid: false for a bad value.
Changes
No recorded changes to this operation across all 1 revision of this API.