Polygon ID

A polygon is one geography inside an area (container): for example one postcode, one municipality or one custom shape. Its ID is the polygon ID.

Polygon IDs are listed per area in the container details (reference). You need the Container ID:

curl 'https://app-api.geposit.se/v2.0/container/{container_id}?with_geo_names=true' \
  --header 'x-api-key: {API_KEY}'
{
  "id": "CONTAINER_ID",
  "name": "Arvidsjaur",
  "geo_ids_ref_groups": [
    {
      "ref_id": "REF_ID",
      "geo_type": "postalcode_5",
      "country": "se",
      "geo_ids": [
        {
          "polygon_id": "POLYGON_ID",
          "feature_id": "FEATURE_ID",
          "geo_name": "93391",
          "geo_code": "93391"
        }
      ]
    }
  ],
  "custom_polygons": []
}

(Shortened.) Each geo_ids[].polygon_id is a polygon ID. To list the polygons of every area in a map at once, use GET /v2.0/layer/map/{map_id}/area?with_geo_names=true (see Layer ID).

To fetch the stored records for polygon IDs you already have, post them as a JSON array (reference):

curl https://app-api.geposit.se/v2.0/geometry/polygon/multi/list \
  --header 'x-api-key: {API_KEY}' \
  --header 'content-type: application/json' \
  --data '["{polygon_id}"]'
[
  {
    "polygon_id": "POLYGON_ID",
    "ref_id": "REF_ID",
    "feature_id": "FEATURE_ID",
    "map_id": "MAP_ID",
    "container_id": "CONTAINER_ID",
    "type": "default",
    "created_at": "2024-03-08T12:33:14.881015Z",
    "updated_at": "2024-03-08T12:33:14.881015Z"
  }
]

The record does not contain the geometry. To get the shape, see Retrieve geometries for a postcode.


Did this page help you?