Try It!

Create areas and set attributes

Create an area based on postcodes and assign a attributes values to each postcode

The Geposit API allows businesses to visualise data connected on interactive maps for further analysis, exploration and actionable insights. The following use case demonstrates the creation of an area and assigning attributes via the Geposit API.

Before you start

Before you start, you need to have an API key and access to Geposit Atlas. If you don't have one, please contact us at [email protected] or learn more on Atlas zoning features.

This example assumes that you already created your map and assigned an attribute list to your areas for the map. You can create your map here: https://app.geposit.se/maps and create an attribute list to your areas here: https://app.geposit.se/attributes

Create area based on postcodes

Utilising the Geospatial API, developers can programmatically define custom sales areas on the map within the Atlas platform. By specifying administrative levels or coordinates, users can accurately represent their sales territories, store locations, or market segments. The API provides methods to efficiently create these sales areas, ensuring accurate spatial representation.

The following three API calls create a "group/layer", a "container/area" built from Swedish postcodes.

Create a new group/layer

Read more about creating and managing groups.

curl --request POST \
     --url 'https://app-api.geposit.se/v2.0/layer?api_key={API_TOKEN}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "type": "area",
  "map_id": "{map_id}",
  "name": "My Group"
}
'

Create a new container/area

Read more on creating and maintaining containers and areas.

curl --request POST \
     --url 'https://app-api.geposit.se/v2.0/container?api_key={API_TOKEN}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "layer_id": "{layer_id}",
  "map_id": "{map_id}",
  "name": "My Sales"
}
'

Add postcode to the container/area

Read more on enriching your areas with administrative geographies and custom shapes.

curl --request POST \
     --url 'https://app-api.geposit.se/v2.0/geometry/polygon/?api_key={API_TOKEN}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "country_code": "se",
  "container_id": "{container_id}",
  "geo_name": "11127",
  "map_id": "{map_id}",
  "type": "default",
  "geo_type": "postalcode_5",
}
'

After the three API requests you should see the following result in the Atlas UI:
Screenshot 2023-10-04 at 12.32.49.png

Assign attributes to areas

Incorporating the Geospatial API, users can dynamically associate revenue attributes to specific sales areas. This functionality allows businesses to link financial performance metrics to geographic regions, enabling deeper insights into the correlation between spatial distribution and revenue generation. Through the API, revenue data can be efficiently attributed to the defined sales areas.

Read more on assigning and filtering areas using attributes.

curl --request POST \
     --url 'https://app-api.geposit.se/v2.0/attribute/map/{map_id}/object-type/polygon?api_key={API_TOKEN}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
[
  {
    "attribute_id": "{attribute_id}",
    "object_id": "{object_id/id of the polygon}",
    "object_type": "polygon",
    "type": "numeric",
    "value": 12345
  }
]
'

Explore the data in Atlas

After leveraging the Geospatial API to establish sales areas and revenue attributes, users can seamlessly transition to the Atlas platform's intuitive user interface (UI), here https://app.geposit.se/maps. Within the UI, stakeholders can visually explore the sales data, interact with the map, and access insightful visualizations. The UI empowers users to delve into the geographic distribution of revenue, identify trends, and uncover patterns that contribute to informed decision-making.


Note: By assigning attribute lists and attribute values to your areas you can increase the query possibilities and filter your areas based on specific attributes. See the API explorer for more information on the API support.