This endpoint allows you to list the administrative boundaries for the country associated with your account, along with the simplified GPS geometry for those boundaries in GEOJSON format.
Listing Boundaries
A GET
returns the boundaries for your organization with the following fields. To include geometry,
specify geometry=true
.
- osm_id - the OSM ID for this boundary prefixed with the element type (string).
- name - the name of the administrative boundary (string).
- parent - the id of the containing parent of this boundary or null if this boundary is a country (string).
- level - the level: 0 for country, 1 for state, 2 for district (int).
- geometry - the geometry for this boundary, which will usually be a MultiPolygon (GEOJSON).
Note that including geometry may produce a very large result so it is recommended to cache the results on the client side.
Example:
GET /api/v2/boundaries.json?geometry=true
Response is a list of the boundaries on your account
{
"next": null,
"previous": null,
"results": [
{
"osm_id": "1708283",
"name": "Kigali City",
"parent": {"osm_id": "171496", "name": "Rwanda"},
"level": 1,
"aliases": ["Kigari"],
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[7.5251021, 5.0504713],
[7.5330272, 5.0423498]
]
]
]
}
},
...
}