▪ Create Geometry
Create Geometry API allows a user to create a custom geometry that identifies a {Location}
.
Request
Endpoint
POST
/v4/{billing_plan}/account/{account_id}/geometry/wkt
Path Parameters
Name | Description | Type | Examples |
---|---|---|---|
*{billing_plan} | Billing plan to be applied to the call. | string | ondemand |
*{account_id} | Provided identifier of the account. | string |
Header Parameters
Name | Description | Type | Examples |
---|---|---|---|
*x-api-key | Provided API key {x_api_key} that allows authentication. |
string | |
*Authorization | Provided token {jwt_bearer} that allows authorization. |
string | Bearer {jwt_bearer} |
Body
Geometry
Name | Description | Type | Examples |
---|---|---|---|
*name | Description of the geometry. | string | Florence Star |
*geometry | Geometry in WKT format. | string | POLYGON((10.614595 43.833381, 10.96118 43.850282, 11.172152 44.178572, 11.455479 43.889604, 11.952009 43.904757, 11.491356 43.622749, 11.815152 43.347745, 11.222191 43.505484, 10.84784 43.311439, 10.948434 43.641572, 10.614595 43.833381)) |
Example
curl -X POST 'https://api.datappeal.io/v4/ondemand/account/{account_id}/geometry/wkt' \
-H 'x-api-key: {x_api_key}' \
-H 'Authorization: Bearer {jwt_bearer}' \
-H 'Content-Type: application/json' \
-d '{
"name" : "Florence Star",
"geometry" : "POLYGON((10.614595 43.833381, 10.96118 43.850282, 11.172152 44.178572, 11.455479 43.889604, 11.952009 43.904757, 11.491356 43.622749, 11.815152 43.347745, 11.222191 43.505484, 10.84784 43.311439, 10.948434 43.641572, 10.614595 43.833381))"
}'
Response
Status
Status | Description |
---|---|
201 | Geometry has been successfully created. |
Body
SavedGeometry
Field | Description | Type | Examples |
---|---|---|---|
*id | Geometry hashed identifier. | string | 379c730942e570d586a5520770c0a65d 4442852e86f5ef4cf241a43bac90a6dcfh |
*geometry | Geometry in WKT format. | string | POLYGON((10.614595 43.833381, 10.96118 43.850282, 11.172152 44.178572, 11.455479 43.889604, 11.952009 43.904757, 11.491356 43.622749, 11.815152 43.347745, 11.222191 43.505484, 10.84784 43.311439, 10.948434 43.641572, 10.614595 43.833381)) |
*name | Description of the geometry. | string | Florence Star |
*simplification | Simplification level of geometry . |
string | None PreserveTopology Simple |
Possible values for simplification
Creating a geometry, the saved polygon will be made valid (e.g. if providing an open polygon, will be made closed) and saved without any simplification.
In this call the only possible value for field simplification
is the following:
- None
Example
{
"id": "379c730942e570d586a5520770c0a65d",
"geometry": "POLYGON((10.614595 43.833381, 10.96118 43.850282, 11.172152 44.178572, 11.455479 43.889604, 11.952009 43.904757, 11.491356 43.622749, 11.815152 43.347745, 11.222191 43.505484, 10.84784 43.311439, 10.948434 43.641572, 10.614595 43.833381))",
"name": "Florence Star",
"simplification": "None"
}