The Geometry API Union operation calculated union of pair or more geometries (polygons or multi-polygons) previously generated with Geoapify APIs. For example, you can calculate union of isolines.
The typical Union operation request URL looks like:
- operation - name of the operation. Possible values: "union", "intersection";
- id - id of a geometry. The id is provided in the response of previously called API
- apiKey - your Geoapify key
NOTE! A call to geometry API is charged as a call to Places or Geocoding API. However, one call is calculated for each geometry pair. So if you provide 4 ids in the request, it will be calculated as 3 requests.
Authenfication and API key
To use the Geometry API, you'll need an API key. You can register and get a Geometry API Key for free without a credit card.
We offer a free plan, so there's no need to stress about cost. Start for free and upgrade to a paid plan when the needs of your project increase. For more information on our plans, visit the Pricing page.
How to get Geoapify API key
- Register on Geoapify MyProjects page
- Create a new project.
- Go to the API Keys section. One API key is generated automatically. You can generate multiple API keys per project if required.
- Optionally, you can protect the API key by listing allowed IP addresses, HTTP referrers, origins, and CORS.
- Choose "Geometry API" and an API key to generate a URL and programming code.
- Press the "Try" button to execute the API call and get the result object example.
Geometry API allows applying geometric operations (for example, union or intersection) to polygons and multi-polygons built with Geoapify APIs. The API works via HTTP Get request.
|apiKey||Required parameter for API key|
|operation||The applied operation. Possible values: "union", "intersection".|
|id||Geometry id returned previously by one of the Geoapify APIs. The minimum required amount of ids is two.|
NOTE! A call to geometry API is charged as a call to Places or Geocoding API. However, one call is calculated for each geometry pair. So if you provide 4 ids in the request, it will be calculated as 3 credits.
The response object contains a GeoJSON FeatureCollection object.
|features||Contains Feature objects of type "Multipolygon".|
|error||Error object, containing the error description and details.|
The API call cost is calculated in credits. This helps us keep pricing simple and make our APIs universally usable:
|API name||Cost in credits||Example|
|Geometry API||1 request = (NUMBER_OF_GEOMETRIES - 1) credits||A union of 3 isilines costs 2 credits|
Please choose from our various Pricing Plans to suit your needs, including a Free Plan with 3000 credits/day included.