Skip to content

Tasking


The Tasking portion of the MGP_SDK provides customers the ability to submit tasking requests for new imagery collection within a specified date range and area of interest. A tasking request will automatically trigger a monitor that will look for matching imagery as it collects according to the tasking request. Upon a match, the user will be notified of the acquisition and an order will be automatically placed to the pipeline the user selected as part of the tasking request, which includes ARD and Core Imagery.


Getting Started

from MGP_SDK.interface import Interface

tasking = Interface().tasking_service

Package methods

New Tasking

new_tasking()

Initiates the creating of a tasking request (async) using one of the preconfigured recipes: 50cm_Color, 30cm_Color. If a kwarg is null or not provided, default recipe value will be used.

Args:

  • start_datetime: ISO-8601 formatted date when the tasking request should start
  • end_datetime: ISO-8601 formatted date when the tasking request should end
  • aoi_geojson: Geojson polygon of area to cover with the tasking request
  • recipe: the name of one of the configured recipes for the tasking request, e.g. "50cm_Color" or "30cm_Color"
  • order_templates: Template for order to be placed. See ordering_service for examples
  • validate: bool, Binary whether to validate tasking request. Defaults to False

Kwargs:

  • max_cloud_cover: double, Maximum cloud cover.
  • max_off_nadir_angle: double, Maximum off nadir angle.
  • max_sun_elevation_angle**: double, Maximum sun elevation angle.
start_datetime = "2023-05-01 18:34:57Z"
end_datetime = "2024-04-30 18:34:57Z"
geo_json = {"coordinates": [
    [
        [-106.8, 35.1],
        [-106.4, 35.1],
        [-106.4, 35.4],
        [-106.8, 35.4],
        [-106.8, 35.1]
    ]
],
    "type": "Polygon"
}
recipe = "50cm_Color"
order_templates = "order:template"
max_cloud_cover = 0.02
max_off_nadir_angle = 30.0
min_sun_elevation_angle = 45.0


tasking.new_tasking(start_datetime, end_datetime, geo_json, recipe, order_templates, max_cloud_cover, 
                    max_off_nadir_angle, min_sun_elevation_angle)

Cancel a Tasking

cancel_tasking()

Initiates the canceling of a tasking request (async)

Args:

  • tasking_id: (str) ID of the requested tasking request
  • reason: (str) Reason for canceling the tasking request
tasking.cancel_tasking('131173789789914064', 'test')

Get Tasking Request

get_tasking_request()

Retrieves a tasking request

Args:

  • tasking_id: (str) ID of the requested tasking request
details = tasking.get_tasking_request('131173789789914064')

Tasking List

tasking_list()

Retrieves a page listing of all tasking request based upon query parameters. Limited to the authenticated user's group

Kwargs:

  • limit: (int) how many items to return in the response list. Default 10
  • filter: (str, list[str]) filter results that match values contained in the given key separated by a colon.
    • Ex. recipe:50cm_Color These are not exact matches, so filtering on a value of string:aab will return all string:aab along with string:aabb. Note: filter field may be repeated if multiple filters are desired. If so, supply as a list.
  • sort: (str) indicates sort order, asc (default) and desc for reverse alphabetical by name
taskings = tasking.tasking_list(limit=5, filter=['recipe:50cm_Color, tasking_status:Accepted'], sort='desc')