Order new geospatial data to be captured over a specific area and at a given time.
View repositoryConstants
Constant | Description | Value |
---|---|---|
Geometry | Geometry types. | Union[catalog.Geometry, geom.Point] |
QuotationDecision | An acceptable decision for a not decided quotation. | Literal["ACCEPTED", "REJECTED"] |
QuotationStatus | Decision statuses for quotations. | Union[Literal["NOT_DECIDED"], QuotationDecision] |
FeasibilityStatus | Decision statuses for feasibility studies. | Literal["NOT_DECIDED", "ACCEPTED"] |
A class that enables access to the tasking functionality. This class also inherits methods from the CatalogBase class.
Methods
3.0.0
. Use BatchOrderTemplate
. Constructs an order form for a specific data product. Returns order.OrderParams
.
Parameter | Description |
---|---|
data_product_id | str The data product ID. |
name | str The order name. |
acquisition_start | Union[str, datetime.datetime] The start date of the acquisition period in the YYYY-MM-DD format. |
acquisition_end | Union[str, datetime.datetime] The end date of the acquisition period in the YYYY-MM-DD format. |
geometry | Geometry The order geometry. |
tags | Optional[List[str]] A list of tags that categorize the order. |
tasking = up42.initialize_tasking()
tasking.construct_order_parameters( data_product_id="123eabab-0511-4f36-883a-80928716c3db", name="PNeo tasking order", acquisition_start="2023-11-01", acquisition_end="2023-12-20", geometry = { "type": "Polygon", "coordinates": ( ( (13.375966, 52.515068), (13.375966, 52.516639), (13.378314, 52.516639), (13.378314, 52.515068), (13.375966, 52.515068), ), ), }, tags=["project-7", "optical"],)
3.0.0
. Use Quotation.all
. Retrieves quotations for tasking orders. Returns list[dict]
.
Parameter | Description |
---|---|
quotation_id | Optional[str] The quotation ID. |
workspace_id | Optional[str] The workspace ID. Use to get quotations from a specific workspace. Otherwise, quotations from the entire account will be returned. |
order_id | Optional[str] The order ID. |
decision | Optional[List[QuotationStatus]] The status of quotations. |
sortby | str Arranges elements in the order specified in descending based on a chosen field. The default value is createdAt . |
descending | bool Determines the arrangement of elements:
True . |
tasking = up42.initialize_tasking()
tasking.get_quotations( workspace_id="68567134-27ad-7bd7-4b65-d61adb11fc78", decision="NOT_DECIDED", sortby="updatedAt", descending=False,)
This method is deprecated and will be removed in 3.0.0
. Use Quotation.accept
/Quotation.reject
and
Quotation.save
.
Allows you to accept or reject a quotation for a tasking order. You can only perform actions with feasibility studies with the NOT_DECIDED
status. Returns dict
.
Parameter | Description |
---|---|
quotation_id | str The quotation ID. |
decision | QuotationDecision The decision made for this quotation. |
tasking = up42.initialize_tasking()
tasking.decide_quotation( quotation_id="68567134-27ad-7bd7-4b65-d61adb11fc78", decision="ACCEPTED",)
3.0.0
. Retrieves feasibility studies for tasking orders. Returns list[dict]
.
Parameter | Description |
---|---|
feasibility_id | Optional[str] The feasibility study ID. |
workspace_id | Optional[str] The workspace ID. Use to get feasibility studies from a specific workspace. Otherwise, feasibility studies from the entire account will be returned. |
order_id | Optional[str] The order ID. |
decision | Optional[List[FeasibilityStatus]] The status of feasibility studies. |
sortby | str Arranges elements in the order specified in descending based on a chosen field. The default value is createdAt . |
descending | bool Determines the arrangement of elements:
True . |
tasking = up42.initialize_tasking()
tasking.get_feasibility( workspace_id="68567134-27ad-7bd7-4b65-d61adb11fc78", decision="NOT_DECIDED", sortby="updatedAt", descending=False,)
3.0.0
. Allows you to accept one of the proposed feasibility study options. You can only perform actions with feasibility studies with the NOT_DECIDED
status. Returns dict
.
Parameter | Description |
---|---|
feasibility_id | str The feasibility study ID. |
accepted_option_id | str The ID of the feasibility option to accept. |
tasking = up42.initialize_tasking()
tasking.choose_feasibility( feasibility_id="68567134-27ad-7bd7-4b65-d61adb11fc78", accepted_option_id="a0d443a2-41e8-4995-8b54-a5cc4c448227",)
A class that contains predefined sorting fields.
Attributes
Attribute | Description |
---|---|
created_at | utils.SortingField Sorts by creation date. The default order is ascending. |
updated_at | utils.SortingField Sorts by update date. The default order is ascending. |
decided_at | utils.SortingField Sorts by decision date. The default order is ascending. |
credits_price | utils.SortingField Sorts by price, in credits. The default order is ascending. |
# Sort by creation date, from the most recent to the earliestquotations_sorted = up42.Quotation.all(sort_by=up42.QuotationSorting.created_at.desc)
# Sort by the last update date, from the most recent to the earliest# quotations_sorted = up42.Quotation.all(sort_by=up42.QuotationSorting.updated_at.desc)
# Sort by decision date, from the most recent to the earliest# quotations_sorted = up42.Quotation.all(sort_by=up42.QuotationSorting.decided_at.desc)
# Sort by price, from the highest to the lowest# quotations_sorted = up42.Quotation.all(sort_by=up42.QuotationSorting.credits_price.desc)
# Define output for one of the sorting examplesfor quotation in list(quotations_sorted)[:5]: # Print first 5 results print(f"- Quotation ID: {quotation.id}") print(f" Decision: {quotation.decision}") print(f" Price: {quotation.credits_price} credits") print(f" Created at: {quotation.created_at}\n")
A data class that represents a quotation for a tasking order.
Attributes
Attribute | Description |
---|---|
id | str The quotation ID. |
created_at | str The time the quotation was created. |
updated_at | str The last time the quotation data was changed. |
decided_at | Optional[str] The time the decision was made on this quotation. |
account_id | str The account ID. |
workspace_id | str The workspace ID. |
order_id | str The order ID. |
credits_price | int The amount of credits that will be charged. |
decision | QuotationStatus The decision for this quotation. |
# Select a quotationquotation_id = "a3210ea7-1570-4c28-9052-d3fbe45ae30c"
# Get the specific quotation by its IDquotation = next(up42.Quotation.all(quotation_id=quotation_id))
# Define outputprint(f"Quotation details for ID: {quotation.id}")print(f"Created at: {quotation.created_at}")print(f"Updated at: {quotation.updated_at}")print(f"Decided at: {quotation.decided_at}")print(f"Order ID: {quotation.order_id}")print(f"Price: {quotation.credits_price} credits")print(f"Decision: {quotation.decision}")
Methods
Marks the quotation as accepted by setting its decision attribute to ACCEPTED
. Use save
to apply the change.
# Select the quotationquotation_id = "b3b17f05-d9b5-47a1-a8d6-e15196f1204e"
quotation = next(up42.Quotation.all(quotation_id=quotation_id))print(f"Fetched quotation: {quotation.id}")print(f"Initial decision: {quotation.decision}")
# Accept the quotation locallyquotation.accept()
# Save the decision to the serverquotation.save()
# The object is updated with the server responseprint(f"Final decision: {quotation.decision}")print(f"Decided at: {quotation.decided_at}")
Marks the quotation as accepted by setting its decision attribute to REJECTED
. Use save
to apply the change.
# Select the quotationquotation_id = "b3b17f05-d9b5-47a1-a8d6-e15196f1204e"
quotation = next(up42.Quotation.all(quotation_id=quotation_id))print(f"Fetched quotation: {quotation.id}")print(f"Initial decision: {quotation.decision}")
# Reject the quotation locallyquotation.reject()
# Save the decision to the serverquotation.save()
# The object is updated with the server responseprint(f"Final decision: {quotation.decision}")print(f"Decided at: {quotation.decided_at}")
Saves any changes to the decision status of the quotation and updates the properties.
# Select the quotationquotation_id = "b3b17f05-d9b5-47a1-a8d6-e15196f1204e"
quotation = next(up42.Quotation.all(quotation_id=quotation_id))print(f"Fetched quotation: {quotation.id}")print(f"Initial decision: {quotation.decision}")
# Accept the quotation locallyquotation.accept()
# Save the decision to the serverquotation.save()
# The object is updated with the server responseprint(f"Final decision: {quotation.decision}")print(f"Decided at: {quotation.decided_at}")
Retrieves quotations based on optional filter parameters. Returns Iterator["Quotation"]
. Use itertools.islice
to offset and limit the results.
Parameter | Description |
---|---|
quotation_id | Optional[str] The quotation ID. |
workspace_id | Optional[str] The workspace ID. Use to get objects from a specific workspace. Otherwise, objects from the entire account will be returned. |
order_id | Optional[str] The order ID. |
decision | Optional[List[QuotationStatus]] The status of quotations. |
sort_by | Optional[utils.SortingField] The results sorting method that arranges elements in ascending or descending order based on a chosen field. |
# Select an orderorder_id = "ea36dee9-fed6-457e-8400-2c20ebd30f44"
# Get all 'NOT_DECIDED' quotations for the specified orderquotations = up42.Quotation.all( order_id=order_id, decision=["NOT_DECIDED"],)
# Define outputprint(f"Quotations for order ID: {order_id}")for quotation in quotations: print(f"- Quotation ID: {quotation.id}") print(f" Status: {quotation.decision}") print(f" Price: {quotation.credits_price} credits") print(f" Created at: {quotation.created_at}\n")