Order templates in SDK

Use templates to create tasking and catalog orders.


Overview

Order new or archive geospatial data.

View repository

Constants

ConstantDescriptionValue
UnitTypeThe type of unit.Literal["SQ_KM", "SCENE"]

Class: OrderError

A data class that represents errors encountered during order cost estimation or creation.

Attributes

AttributeDescription
indexint
The failed geometry index number.
messagestr
The error message associated with the failed geometry.
detailsstr
Error message details.

Class: OrderReference

A data class that represents references to orders in the system.

Attributes

AttributeDescription
indexint
A sequence identifier for the order reference.
idstr
The order ID.

Properties

order

Retrieves the full details of the order associated with the reference.

Python

    from up42.order_template import OrderReference

# Select an order
order_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"

# Create an OrderReference instance for the given order and access order details
order_ref = OrderReference(index=0, id=order_id)
full_order = order_ref.order

# Define output
print(f"Display name: {getattr(full_order, 'display_name', 'N/A')}")
print(f"Status: {full_order.status}")
# print(f"Substatus: {full_order.details.sub_status}") # for tasking orders
# print(f"Acquisition start date: {full_order.details.acquisition_start}") # for tasking orders
# print(f"Acquisition end date: {full_order.details.acquisition_end}") # for tasking orders
# print(f"Order description: {full_order.details.extra_description}") # for tasking orders
# print(f"Geometry: {full_order.details.geometry}") # for tasking orders
tags = getattr(full_order, "tags", [])
print("Tags:", ", ".join(tags) if tags else "No tags")

  

Class: OrderCost

A data class that represents the cost details of an order.

Attributes

AttributeDescription
indexint
The geometry index number. Indexing starts from zero.
creditsfloat
The estimated cost of the geometry, in credits.
sizefloat
The size of the geometry.
unitUnitType
The unit of measurement used to calculate the size.

Class: Estimate

A data class that represents the estimated cost of a tasking or catalog order batch.

Attributes

AttributeDescription
itemslist[Union[OrderCost, OrderError]]
A list of geometries in the estimation. It might include successful cost details (OrderCost) or errors encountered during the estimation (OrderError).
creditsfloat
The estimate of the order batch cost, in credits.
sizefloat
The size of the order batch in square kilometers or the number of scenes needed to cover the requested geometry.
unitUnitType
The unit of measurement used to calculate the size.

Python

    # Define order geometry
geometry = {
    "type": "Polygon",
    "coordinates": [[
        [13.369713, 52.452327],
        [13.369713, 52.470760],
        [13.339159, 52.470760],
        [13.339159, 52.452327],
        [13.369713, 52.452327]
    ]]
}

# Wrap the geometry into a GeoJSON FeatureCollection
features = geojson.FeatureCollection(features=[geojson.Feature(geometry=geometry)])

# Instantiate a BatchOrderTemplate with the given parameters
order_template = up42.BatchOrderTemplate(
    data_product_id="c3de9ed8-f6e5-4bb5-a157-f6430ba756da",
    display_name="Sentinel-2 over Berlin",
    features=features,
    params={
        "id": "S2B_T32UQD_20250520T102551_L2A"
    },
    tags=["sentinel-berlin"]
)

# Estimate the cost
estimate = order_template.estimate

# Define output
print(f"Total credits: {estimate.credits}")
print(f"Total size: {estimate.size} {estimate.unit}")
print("Geometry items:")
for item in estimate.items:
    print(f"    - Index: {item.index}")
    print(f"      Credits: {item.credits}")
    print(f"      Size: {item.size} {item.unit}")

  

Class: BatchOrderTemplate

A data class that defines a template for creating and estimating batch orders.

Attributes

AttributeDescription
data_product_idstr
The data product ID.
display_namestr
A human-readable name that describes the order.
tagslist[str]
A list of tags that categorize the order. A tag can consist of letters, numbers, spaces, and special characters (., -, _, /, :). If the list is empty, tags will be removed.
featuresgeojson.FeatureCollection
A GeoJSON FeatureCollection representing the order’s geometry.
paramsdict
Order parameters. To retrieve the required and optional parameters needed to create an order for a specific data product, use DataProduct.schema.

Python

    # Define order geometry
geometry = {
    "type": "Polygon",
    "coordinates": [[
        [13.369713, 52.452327],
        [13.369713, 52.470760],
        [13.339159, 52.470760],
        [13.339159, 52.452327],
        [13.369713, 52.452327]
    ]]
}

# Wrap the geometry into a GeoJSON FeatureCollection
features = geojson.FeatureCollection(features=[geojson.Feature(geometry=geometry)])

# Instantiate a BatchOrderTemplate with the given parameters
order_template = up42.BatchOrderTemplate(
    data_product_id="c3de9ed8-f6e5-4bb5-a157-f6430ba756da",
    display_name="Sentinel-2 over Berlin",
    features=features,
    params={
        "id": "S2B_T32UQD_20250520T102551_L2A"
    },
    tags=["sentinel-berlin"]
)

  

Methods

place

Submits a batch order. Returns list[Union[OrderReference, OrderError]].

Python

    # Define order geometry
geometry = {
    "type": "Polygon",
    "coordinates": [[
        [13.369713, 52.452327],
        [13.369713, 52.470760],
        [13.339159, 52.470760],
        [13.339159, 52.452327],
        [13.369713, 52.452327]
    ]]
}

# Wrap the geometry into a GeoJSON FeatureCollection
features = geojson.FeatureCollection(features=[geojson.Feature(geometry=geometry)])

# Instantiate a BatchOrderTemplate with the given parameters
order_template = up42.BatchOrderTemplate(
    data_product_id="c3de9ed8-f6e5-4bb5-a157-f6430ba756da",
    display_name="Sentinel-2 over Berlin",
    features=features,
    params={
        "id": "S2B_T32UQD_20250520T102551_L2A"
    },
    tags=["sentinel-berlin"]
)

order_template.place

  

Last updated: