---
title: "Point in polygon check, plus bounding box, centroid and area for GeoJSON"
method: GET
path: "/v1/geo/polygon"
tags: ["deterministic", "no-api-key", "geo", "geojson", "geometry"]
---

# Point in polygon check, plus bounding box, centroid and area for GeoJSON

`GET /v1/geo/polygon`

## Request

- Base URL: `https://api.duoleads.com`
- URL: `https://api.duoleads.com/v1/geo/polygon`
- Auth: none declared

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

## Query parameters

- `geometry` string, required
- `lat` number
- `lon` number
- `ops` string

## Response `200`

Paid and settled. `data` is route-specific; a route that judges its input returns 200 with `data.valid: false` for a bad value.

- object
  - `ok` unknown, required
  - `route` '/v1/geo/polygon', required
  - `version` '1.0.0', required
  - `data` object, required: 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.
    - `contains` boolean, nullable
    - `on_boundary` boolean, nullable
    - `bbox` number[]
    - `centroid` object
      - `lat` number, required
      - `lon` number, required
    - `area_m2` number
    - `perimeter_m` number
    - `winding` string[]
    - `rings` integer, required
    - `vertices` integer, required
  - `meta` Meta, required
    - `disclaimer` string, required: Legal short disclaimer, identical on every response.
    - `request_id` string, required: ULID.
    - `computed_at` string, date-time, required: RFC 3339 UTC with milliseconds.
    - `price_usd` string, required: Decimal string, "0.05".
    - `deterministic` boolean, required
    - `sources` object[]: Present only on routes that read a vendored dataset: the exact edition that answered.
      - `id` string, required
      - `version` string, required
      - `published` string, required
      - `attribution` string
      - `licence` string

## Other responses

- `400`: MISSING_PARAM, INVALID_PARAM or UNSUPPORTED_VALUE. Not charged: validation runs before the paywall.
- `402`: Payment required. No valid PAYMENT-SIGNATURE was supplied: read the base64 PAYMENT-REQUIRED header (or this body) for the price ($0.05 = 50000 atomic USDC on eip155:8453), sign an EIP-3009 authorization and retry. Also returned when settlement is declined (PAYMENT_FAILED). Nothing is charged on a 402.
- `404`: NOT_FOUND: unknown path. Not charged.
- `405`: METHOD_NOT_ALLOWED: only GET and HEAD are served. Not charged.
- `413`: INPUT_TOO_LARGE: a parameter exceeded its documented maximum length. Not charged.
- `500`: INTERNAL: a server bug. Not charged.

---

[API](https://skmtc.dev/duoleads/apis/duo-data-utilities-iban-isin-vat-tax-id-barcode-timezone-geo.md) · [All operations](https://skmtc.dev/duoleads/apis/duo-data-utilities-iban-isin-vat-tax-id-barcode-timezone-geo/llms.txt) · [OpenAPI document](https://skmtc.dev/duoleads/apis/duo-data-utilities-iban-isin-vat-tax-id-barcode-timezone-geo/revisions/18790d59615e?raw)
