Update 'Create-Taskmap.md'

This commit is contained in:
Mark van der Wal 2021-02-10 19:15:23 +00:00
parent 43aaad44ec
commit ae07a10e7e

View File

@ -1,30 +1,73 @@
## Create taskmap ## Create taskmap
The user can use the "ItemTask" API to execute the TaskmapTask with the item code which contains the tiff data in {code}. The user can use the "ItemTask" API to execute the TaskmapTask with the cropfield item code in {code}.
{itemCode} should contain the item with tiff data.
> Request
```javascript **~! REMEMBER, creating a taskmap with a high resolution < 1 can take a considerable time (from minutes up to hours). !~**
POST /api/v1/items/{code}/tasks **~! It helps to lower the precision to say 1 or 0 if a high resolution is needed. !~**
{
"taskType": "vnd.farmmaps.task.taskmap" > Request
} ```javascript
``` POST /api/v1/items/{code}/tasks
> Response 201 {
```javascript "taskType": "vnd.farmmaps.task.taskmap"
{ }
"code": "string", ```
"taskType": "vnd.farmmaps.task.taskmap", > Response 201
"delay": "", ```javascript
"attributes": { {
"additionalProp1": "string", "code": "string",
"additionalProp2": "string", "taskType": "vnd.farmmaps.task.taskmap",
"additionalProp3": "string" "attributes": {
} "inputCode" "{itemCode}"
} "operation": "shape", // currently only "shape" supported
``` "cellWidth": "10", // in metres
"cellHeight": "5", // in metres
Response 400 Tasktype not found "startPoint": "{
Response 401 Not authenticated \"type\": \"Point\",
Response 403 No WRITE permissions in item \"coordinates\": [6.014414493084948, 53.08996024180022]
Response 404 Item not found }",
"endPoint": "{
This will create the item with shape data as a sibling of the input item. \"type\": \"Point\",
\"coordinates\": [6.014997043859679, 53.090253715796308]
}"
}
}
```
* geojson is expected in WGS84, 4326 projection.
* endPoint is optional but angle or endPoint is needed!
Response 400 Tasktype not found
Response 401 Not authenticated
Response 403 No WRITE permissions in item
Response 404 Item not found
This will create the item with shape data as a sibling of the input item.
##### Optional input parameters #####
There are some optional task attribute input parameters for greater flexibility.
* **inputLayerName**
Allows you to specify which layer to use for an input item.
* **precision** default value of 2 decimals.
Caps the values to {precision} decimals after the .
* **endPoint** geojson geometry. (endpoint or angle is needed!)
point geometry
* **angle** value between 0.0 - 360.0. (endpoint or angle is needed!)
Orientation of the taskmap fishnet.
* **centered** true or false.
centers the abline in the middle of the 'cellWidth' axis.
Default percentile values for nbs are 0.0 and 1.0.
```javascript
{
"inputLayerName": "customLayerName",
"precision": 2,
"angle": 45,
"centered": "true",
"endPoint": "{
\"type\": \"Point\",
\"coordinates\": [6.014997043859679, 53.090253715796308]
}"
}
```