Skip to content

Task

Example task:

{
"id": 134,
"project": 27,
"processing_node": 10,
"processing_node_name": "localhost:3000",
"images_count": 48,
"can_rerun_from": [],
"available_assets": [
"all.zip",
"orthophoto.tif",
"orthophoto.png",
"georeferenced_model.las",
"georeferenced_model.ply",
"georeferenced_model.csv",
"textured_model.zip"
],
"uuid": "4338d684-91b4-49a2-b907-8ba171894393",
"name": "Task Name",
"processing_time": 2197417,
"auto_processing_node": false,
"status": 40,
"last_error": null,
"options": [
{
"name": "use-opensfm-pointcloud",
"value": true
}
],
"created_at": "2017-02-18T18:01:55.402551Z",
"pending_action": null,
"upload_progress": 1.0,
"resize_progress": 0.0,
"running_progress": 1.0
}

A Task is the basic processing unit of WebODM. To compute an orthophoto, point cloud and textured model from a set of images, you need to create a Task.

FieldTypeDescription
idintUnique identifier
projectintProject ID the task belongs to
processing_nodeintThe ID of the Processing Node this task has been assigned to, or null if no Processing Node has been assigned.
processing_node_namestringThe name of the processing node below, or null if no Processing Node has been assigned.
images_countintNumber of images
can_rerun_fromstring[]List of possible “rerun-from” options that this task could restart from, given its currently assigned processing node. If this is an empty list, the task can only be restarted from the start of the pipeline.
available_assetsstring[]List of assets available for download
uuidstringUnique identifier assigned by a Processing Node once processing has started.
namestringUser defined name for the task
processing_timeintMilliseconds that have elapsed since the start of processing, or -1 if no information is available. Useful for displaying a time status report to the user.
auto_processing_nodebooleanWhether WebODM should automatically assign the next available Processing Node to process this Task. A user can set this to false to manually choose a Processing Node.
statusintOne of Status Codes, or null if no status is available.
last_errorstringThe last error message reported by a Processing Node in case of processing failure.
optionsJSON[]JSON-encoded list of name/value pairs, where each pair represents a command line option to be passed to a Processing Node.
created_atstringCreation date and time.
pending_actionintOne of Pending Actions, or null if no pending action is set.
upload_progressfloatValue between 0 and 1 indicating the upload progress of this task’s files to the processing node.
resize_progressfloatValue between 0 and 1 indicating the resize progress of this task’s images.
running_progressfloatValue between 0 and 1 indicating the running progress (estimated) of this task.

POST /api/projects/{project_id}/tasks/

ParameterRequiredDefaultDescription
images[]*""List of multipart-encoded images (2 minimum)
processing_nodenullThe ID of the Processing Node this Task should be assigned to. If not specified, and auto_processing_node is true, a Processing Node will be automatically assigned.
name""User defined name for the task
auto_processing_nodetrueWhether WebODM should automatically assign the next available Processing Node to process this Task.
options”[]“JSON-encoded list of name/value pairs, where each pair represents a command line option to be passed to a Processing Node.

You assign a Task to a Project by passing the proper project_id path in the URL.

PATCH /api/projects/{project_id}/tasks/{task_id}/

Parameters are the same as above.

POST /api/projects/{project_id}/tasks/import

Import task that have been processed by another WebODM instance (or via webodm.net or NodeODM)

ParameterRequiredDefaultDescription
nameImported TaskUser defined name for the task.
filename*/""File with assets. Must be a zip.
url/*""URL to zipped zipped assets.

You have to provide either filename or url parameter (but not both) in order to import created assets.

Remember to set proper Content-type for the request depending on how the assets are uploaded:

ParameterContent-Type
filenameapplication/zip
urlapplication/x-www-form-urlencoded

Task list:

[
{
"id": 6,
"project": 2,
"processing_node": 2,
"processing_node_name": "localhost:3000",
"images_count": 89,
"uuid": "2e8b687d-c269-4e2f-91b3-5a2cd51b5321",
"name": "Test name",
"processing_time": 8402184,
"auto_processing_node": true,
"status": 40,
"last_error": null,
"options": [],
"created_at": "2016-12-08T13:32:28.139474Z",
"pending_action": null,
"upload_progress": 1.0,
"resize_progress": 0.0,
"running_progress": 1.0
}
]

GET /api/projects/{project_id}/tasks/

Retrieves all Task items associated with project_id.

GET /api/projects/{project_id}/tasks/{task_id}/download/{asset}

After a task has been successfully processed, the user can download several assets from this URL. Not all assets are always available. For example if GPS information is missing from the input images, the orthophoto.tif asset will be missing. You can check the available_assets property of a Task to see which assets are available for download.

AssetDescription
all.zipArchive (.zip) containing all assets, including an orthophoto, TMS tiles, a textured 3D model and point cloud in various formats.
orthophoto.tifGeoTIFF orthophoto.
orthophoto.pngPNG orthophoto.
orthophoto.mbtilesOrthophoto MBTiles archive.
textured_model.zipArchive containing the textured 3D model
georeferenced_model.lasPoint cloud in .LAS format.
georeferenced_model.plyPoint cloud in .PLY format.
georeferenced_model.csvPoint cloud in .CSV format.

GET /api/projects/{project_id}/tasks/{task_id}/assets/{path}

After a task has been successfully processed, its assets are stored in a directory on the file system. This API call allows direct access to the files in that directory (by default: WebODM/app/media/project/{project_id}/task/{task_id}/assets). This can be useful to those applications that want to stream a Potree dataset, or render a textured 3D model on the fly.

Console output example:

Terminal window
curl -H "Authorization: JWT <your_token>" http://localhost:8000/api/projects/2/tasks/1/output/?line=5
[DEBUG] /var/www/data/e453747f-5fd4-4654-9622-b02727b29fc5/images\n[DEBUG] Loaded DJI_0219.JPG | camera: dji fc300s ...

GET /api/projects/{project_id}/tasks/{task_id}/output/

As a Task is being processed, processing nodes will return an output string that can be used for debugging and informative purposes. Output is only available after processing has started.

ParameterRequiredDefaultDescription
line0Only display the output starting from a certain line number. This can be useful to display output in realtime to the user by keeping track of the number of lines that have been displayed to the user so far and thus avoiding to download all output at every request.

POST /api/projects/{project_id}/tasks/{task_id}/cancel/

Stop processing a Task. Canceled tasks can be restarted.

POST /api/projects/{project_id}/tasks/{task_id}/remove/

All assets associated with it will be destroyed also. If the Task is currently being processed, processing will stop.

POST /api/projects/{project_id}/tasks/{task_id}/restart/

If a Task has been canceled or has failed processing, or has completed but the user decided to change processing options, it can be restarted. If the Processing Node assigned to the Task has not changed, processing will happen more quickly compared to creating a new Task, since the Processing Node remembers the uuid of the Task and will attempt to reuse previous results from the computation pipeline.

GET /api/projects/{project_id}/tasks/{task_id}/orthophoto/tiles.json

GET /api/projects/{project_id}/tasks/{task_id}/orthophoto/tiles/{Z}/{X}/{Y}.png

After a task has been successfully processed, a TMS layer is made available for inclusion in programs such as Leaflet or Cesium.

GET /api/projects/{project_id}/tasks/{task_id}/dsm/tiles.json

GET /api/projects/{project_id}/tasks/{task_id}/dsm/tiles/{Z}/{X}/{Y}.png

GET /api/projects/{project_id}/tasks/{task_id}/dtm/tiles.json

GET /api/projects/{project_id}/tasks/{task_id}/dtm/tiles/{Z}/{X}/{Y}.png

In some circumstances, a Task can have a pending action that requires some amount of time to be performed.

Pending ActionCodeDescription
CANCEL1Task is being canceled
REMOVE2Task is being removed
RESTART3Task is being restarted
StatusCodeDescription
QUEUED10Task’s files have been uploaded to a Processing Node and are waiting to be processed.
RUNNING20Task is currently being processed.
FAILED30Task has failed for some reason (not enough images, out of memory, Piero forgot to close a parenthesis, etc.)
COMPLETED40Task has completed. Assets are be ready to be downloaded.
CANCELED50Task was manually canceled by the user.