Documentatie/Create-Taskmap.md

2.2 KiB

Create taskmap

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.

~! REMEMBER, creating a taskmap with a high resolution < 1 can take a considerable time (from minutes up to hours). !~
~! It helps to lower the precision to say 1 or 0 if a high resolution is needed. !~

Request

POST /api/v1/items/{code}/tasks
{  
    "taskType": "vnd.farmmaps.task.taskmap",
    "attributes": {
    "inputCode" "{itemCode}"
    "operation": "shape", // currently only "shape" supported
    "cellWidth": "10", // in metres
    "cellHeight": "5", // in metres
	"startPoint": "{
		\"type\": \"Point\",
		\"coordinates\": [6.014414493084948, 53.08996024180022]
    }",
    "endPoint": "{
		\"type\": \"Point\",
		\"coordinates\": [6.014997043859679, 53.090253715796308]
    }"
  }
}
  • geojson is expected in WGS84, 4326 projection.
  • endPoint is optional but angle or endPoint is needed!

Response 201

{
  "code": "string",
  "taskType": "vnd.farmmaps.task.taskmap"
}

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.

{
    "inputLayerName": "customLayerName",
    "precision": 2,
    "angle": 45,
    "centered": "true",
    "endPoint": "{
		\"type\": \"Point\",
		\"coordinates\": [6.014997043859679, 53.090253715796308]
    }"
}

Endpoint and startpoint are strings! not json!