Custom zones

Draw the cells of a cell zone as GeoJSON

GET
/custom/zones/{id}/geometry

Returns the zone's cells as map geometry, with content type application/geo+json.

  • mode=outline (default): one Feature with a MultiPolygon outline of all cells. Refused with 413 above 50,000 cells.
  • mode=hexes: a FeatureCollection with one hexagon per cell, each carrying h3, zone and the cell's values.
  • max_cells (default 50,000, at most 200,000) caps the cells drawn: a zone over the cap is 413. Narrow with bbox (west,south,east,north).

A zone that is not in a cell layer is 404.

This is our own API, not Geoapify-compatible. Every request costs 1 rivet.

Authorization

queryapiKey<token>

Your API key from the dashboard, sent as ?apiKey=<key>.

Path Parameters

id*string

Zone ID: the zone's layer Place ID, gp:layer:<slug>:<uuid>, exactly as place_id returns it. Colons may be sent raw or as %3A. A bare UUID is 404.

Match^gp:layer:[a-z0-9_]{2,40}:[0-9a-f-]{36}$

Query Parameters

mode?string

outline for one merged shape, hexes for one polygon per cell.

Default"outline"
Value in"outline""hexes"
max_cells?integer

Most cells to draw; a larger zone is 413.

Range1 <= value <= 200000
Default50000
bbox?string

west,south,east,north: draw only cells inside.

Response Body

Cell geometry.

application/geo+json
  1. response

mode=outline: one Feature with a MultiPolygon outline of the zone's cells. mode=hexes: a FeatureCollection with one Polygon per cell, each carrying h3, zone and the cell's values. Served as application/geo+json.

type*unknown
properties*
geometry*
Example Request
curl -X GET 'https://api.data.graphitelab.ai/v1/custom/zones/gp:layer:coverage:3f6c0a52-8c1e-4c5e-9a64-0f1b2d7e9a10/geometry'
Example Response
{  "type": "Feature",  "properties": {    "place_id": "gp:layer:zz_docs_cells:39a16cee-f547-4949-b11d-1937b8e2ef0a",    "n_cells": 4,    "h3_resolution": 7  },  "geometry": {    "type": "MultiPolygon",    "coordinates": [      [        [          [            -86.19749984904684,            39.78378322131236          ],          [            -86.19393512087694,            39.77187661063044          ],          [            -86.20638292050609,            39.76400437536285          ],          [            -86.2028175151417,            39.75210122515446          ],          [            -86.186810979312,            39.7480684675334          ],          [            -86.18325156333132,            39.736166936730164          ],          [            -86.16725141470813,            39.73213198322349          ],          [            -86.15480441943346,            39.73999658270343          ],          [            -86.15835716662637,            39.751899952417844          ],          [            -86.1459032217768,            39.75976603320655          ],          [            -86.14945528087613,            39.77167286390449          ],          [            -86.16546796192402,            39.7757117760056          ],          [            -86.16902601261106,            39.78762022826775          ],          [            -86.18504509447597,            39.79165694025217          ],          [            -86.19749984904684,            39.78378322131236          ]        ]      ]    ]  }}