Drawings
API definition
Goal: store, retrieve & list drawings
End result drawing tool:
(All these fields should eventually be stored in the DB)
End result area manager (list of drawings):
https://gitlab.com/opengeoweb/geoweb-assets/-/issues/2676
MVP drawing
Store:
From User Story:
As a user I want to save my drawn polygon, so I can re-use it.
Save polygon
Additional comments New BE for storing objects? Probably.
MVP design: https://app.zeplin.io/project/5ecf84a3c6ae1047a368f393/screen/64956cfe39ec23476bc3b1c8
MVP list
From User Story:
As a user, I would like to have acces to my saved polygons for further use.
Drawing object manager
Test criteria
Link to design
Suggestion to also be able to open the drawing from the list on the map and in toolbox, otherwise very difficult to test our work
Endpoints needed
JSON: drawing LIST (GET /drawings/ summary of full drawing?)
[
{
"id": "923723984872338768743",
"name": "Drawing area 101",
"lastUpdatedTime": "2022-06-01T12:34:27Z",
"scope": "user",
"area": {...} << NB: Should we include the area here? Better use GET for a single area.
},
{...}
]
with a 200 status
JSON: GET drawing (GET /drawings/{id})
Returns:
{
"id": "923723984872338768743",
"lastUpdatedTime": "2022-06-01T12:34:27Z",
"name": "Drawing area 101",
"scope": "user",
"area"{...<area>...}
}
with a 200 status
JSON: POST drawing (POST /drawings)
POST with content type 'Content-Type: application/json'
{
"name": "Drawing area 101", # has to be unique in the backend for this user.
"scope": "user",
"area": {...<area>...}
}
Returns status 200 with a location header, advertising the new drawing id in the URL:
JSON: UPDATE drawing (POST /drawings/{id})
POST with content type 'Content-Type: application/json' with the drawing id
�{
"name": "New name for drawing area 101",
"scope": "user",
"area": {...<area>...}
}
This API needs to check the credentials, whether it is the same user. (check the Geoweb-UserName against the internal drawing username)
Returns 201 with a location header, advertising the same drawing ID as posted
JSON: DELETE drawing (POST /drawings/{drawing_id}?delete=true)
�This API needs to check the credentials, whether it is the same user. (check the Geoweb-UserName against the internal drawing username)
Returns status 200 upon successful deletion.
Create tickets