{"uid":"cap_0pb1wgdEZ1PtNPjnr114S","slug":"duo-data-utilities-geojson-polygon-geometry-7d8793c8","name":"Duo Data Utilities – GeoJSON Polygon Geometry","description":"Geometric predicates on a GeoJSON geometry supplied in the request: point-in-polygon with correct hole handling, bounding box, centroid, signed area in square metres, perimeter length, and ring winding order. 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.","url":"https://api.duoleads.com/v1/geo/polygon?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["geometry"],"properties":{"lat":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"Point latitude; with lon, runs the containment test."},"lon":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"Point longitude; with lat, runs the containment test."},"ops":{"type":"string","maxLength":128,"description":"Comma-separated subset of contains,bbox,centroid,area,perimeter,winding. Default all."},"geometry":{"type":"string","maxLength":3072,"description":"URL-encoded GeoJSON Polygon, MultiPolygon or a Feature wrapping one. At most 3072 characters and 2000 coordinate pairs."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","route","version","data","meta"],"properties":{"ok":{"const":true},"data":{"type":"object","required":["rings","vertices"],"properties":{"bbox":{"type":"array","items":{"type":"number"}},"rings":{"type":"integer"},"area_m2":{"type":"number"},"winding":{"type":"array","items":{"type":"string"}},"centroid":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"number"},"lon":{"type":"number"}}},"contains":{"type":["boolean","null"]},"vertices":{"type":"integer"},"on_boundary":{"type":["boolean","null"]},"perimeter_m":{"type":"number"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/geo/polygon"},"version":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"bbox":[4.85,52.35,4.95,52.4],"rings":1,"area_m2":37890432.411,"winding":["ccw"],"centroid":{"lat":52.37500000001563,"lon":4.900000000001667},"contains":true,"vertices":4,"on_boundary":false,"perimeter_m":24747.979},"meta":{"price_usd":"0.05","disclaimer":"Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms","request_id":"01K6B7Q4ZC8H3F2M9WXR5TYN0D","computed_at":"2026-09-28T12:00:00.000Z","deterministic":true},"route":"/v1/geo/polygon","version":"1.0.0"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_qSrLxcc6UUkjrtNYvWsdX","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes geometric predicates on a GeoJSON Polygon or MultiPolygon: point-in-polygon containment, bounding box, centroid, geodesic area (m²), perimeter length, and ring winding order.","exampleAgentPrompt":"Does the point at latitude 52.375, longitude 4.9 fall inside this GeoJSON polygon: {\"type\":\"Polygon\",\"coordinates\":[[[4.85,52.35],[4.95,52.35],[4.95,52.4],[4.85,52.4],[4.85,52.35]]]}? Also give me its geodesic area, centroid, and bounding box.","exampleUseCases":[{"title":"Delivery zone containment check","prompt":"I have a GeoJSON polygon defining our delivery zone and a customer at lat 51.505, lon -0.09 — can you tell me whether that point is inside the polygon and also what the polygon's bounding box and centroid are?"},{"title":"Land parcel area measurement","prompt":"I've got a GeoJSON Polygon for a land parcel and I need its geodesic area in square metres and its perimeter length — run all the standard geometry ops on it for me."},{"title":"Winding order audit for map rendering","prompt":"Can you check the ring winding order of this GeoJSON MultiPolygon for me? I want to make sure it's counter-clockwise so it renders correctly, and also grab the centroid while you're at it."}],"resultDescription":"A JSON object containing: ok (true), and a data object with any computed subset of: bbox ([minLon,minLat,maxLon,maxLat]), centroid ({lat,lon}), area_m2 (geodesic area on WGS-84), perimeter_m (geodesic perimeter), winding (array of 'cw'/'ccw' per ring), contains (boolean, if lat/lon provided), on_boundary (boolean), rings (count), vertices (count). Also includes meta with request_id, computed_at timestamp, price_usd, and deterministic flag.","failureModes":["geometry string exceeds 3072 characters — returns error","more than 2000 coordinate pairs — returns error","invalid or malformed GeoJSON — returns validation error","lat/lon out of valid WGS-84 range — returns parameter error","geometry type other than Polygon/MultiPolygon/wrapping Feature — returns unsupported type error","missing required geometry query param — returns 400 bad request","payment not received — returns 402 Payment Required"],"whenToPreferThis":"Choose this endpoint when you need deterministic, server-side geodesic geometry computations on GeoJSON polygons — especially when correct hole handling, accurate WGS-84 area/perimeter at any latitude, or point-in-polygon tests are required without installing a geospatial library. Prefer it over client-side turf.js or PostGIS when you need a stateless, pay-per-call API with no infrastructure setup. Best for single polygon analysis up to 2000 coordinate pairs.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:46:14.634Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-geojson-polygon-geometry-7d8793c8"}