Processing templates in SDK

View processes to run using the SDK.


Overview

Apply advanced processing to purchased geospatial data.

View repository

Shared templates

Single-item processes

Single-item template classes represent processes that require a single STAC item. All single-item process template classes extend the SingleItemJobTemplate class.

Subclasses

Class nameProcess IDProcess
DetectionAircraftOIdetection-aircraft-oiAircraft detection
DetectionBuildingsSpaceptdetection-buildings-spaceptBuilding detection
DetectionCarsOIdetection-cars-oiCar detection
DetectionShadowsSpaceptdetection-shadows-spaceptShadow detection
DetectionShipsAirbusdetection-ships-airbusShip detection
DetectionStorageTanksAirbusdetection-storage-tanks-airbusStorage tank detection
DetectionTreesSpaceptdetection-trees-spaceptTree detection
DetectionTrucksOIdetection-trucks-oiTruck detection
DetectionWindTurbinesAirbusdetection-wind-turbines-airbusWind turbine detection

Pansharpening

Has more attributes, see its class.

pansharpeningPansharpening
UpsamplingNSupsampling-nsUpsampling
UpsamplingNSSentinelupsampling-ns-sentinelUpsampling (Sentinel-2)

Attributes

AttributeDescription
title

str

The title of the output objects: STAC item and STAC collection.

item

pystac.Item

The STAC item to process.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
UP42_client = up42.UP42_client()
stac_item = UP42_client.get_item(stac_item_id)
# Instanitate a DetectionTreesSpacept template
job_template = processing_templates.DetectionTreesSpacept(
title="Detect trees over UK",
item=stac_item,
)

Multi-item processes

Multi-item template classes represent processes that require more than one STAC item. All multi-item process template classes extend the MultiItemJobTemplate class.


Attributes

AttributeDescription
title

str

The title of the output objects: STAC item and STAC collection.

item

List[pystac.Item]

The STAC items to process.

Python
from up42 import processing_templates
# Select multiple items
stac_item1_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
stac_item2_id = "c3de9ed8-f6e5-4bb5-a157-f6430ba756da"
# Get the items from the STAC client
UP42_client = up42.UP42_client()
stac_item1 = UP42_client.get_item(stac_item1_id)
stac_item2 = UP42_client.get_item(stac_item2_id)
# Instantiate a DetectionChangeSpacept template
job_template = processing_templates.DetectionChangeSpacept(
title="Detect changes",
items=[stac_item1, stac_item2],
)

Class: CoregistrationSimularity

A data class that represents a template for the Coregistration process. Extends the JobTemplate class.

Constants

ConstantDescriptionValue
process_idThe process ID.coregistration-simularity

Attributes

AttributeDescription
title

str

A user-defined title for the coregistration job.

source_item

pystac.Item

The STAC item representing the source image to be coregistered.

reference_item

pystac.Item

The STAC Item representing the reference image for coregistration. The positional accuracy of the source image will be improved against this reference.

Python
from up42 import processing_templates
# Select multiple items
source_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
reference_item_id = "c3de9ed8-f6e5-4bb5-a157-f6430ba756da"
# Get the items from the STAC client
stac_client = up42.stac_client()
source_item = next(stac_client.get_items(source_item_id))
reference_item = next(stac_client.get_items(reference_item_id))
# Instantiate a CoregistrationSimularity template
job_template = processing_templates.CoregistrationSimularity(
title="Coregistration for images",
source_item=source_item,
reference_item=reference_item,
)

Class: Pansharpening

A data class that represents a template for the Pansharpening process. Extends the class used for single-item processes.

Attributes

AttributeDescription
grey_weights

Optional[List[GreyWeight]]

The weight factors by which spatial details of multispectral bands are scaled.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
UP42_client = up42.UP42_client()
stac_item = UP42_client.get_item(stac_item_id)
# Instantiate a Pansharpening template with grey weights
job_template = processing_templates.Pansharpening(
title="Pansharpen item",
item=stac_item,
grey_weights=[
processing_templates.GreyWeight(band="red", weight=0.04),
processing_templates.GreyWeight(band="blue", weight=0.9),
processing_templates.GreyWeight(band="green", weight=0.2),
],
)

Class: GreyWeight

A data class that represents the weight factors by which to scale spatial details of multispectral bands.

  • If not specified, the process uses either sensor-optimized weights or optimal generated weights.
  • If you specify the weights yourself, you must define at least 3 bands.

Attributes

AttributeDescription
band

str

The name of the band from the STAC asset with the ["data", "multispectral"] roles.

weight

float

The multiplication value that lets you modulate the influence of multispectral bands on the final image. The range of allowed values spans from -1 to 1.

Python
from up42 import processing_templates
# Select an item
stac_item_id = "68567134-27ad-7bd7-4b65-d61adb11fc78"
# Get the item from the STAC client
UP42_client = up42.UP42_client()
stac_item = UP42_client.get_item(stac_item_id)
# Instantiate a Pansharpening template with grey weights
job_template = processing_templates.Pansharpening(
title="Pansharpen item",
item=stac_item,
grey_weights=[
processing_templates.GreyWeight(band="red", weight=0.04),
processing_templates.GreyWeight(band="blue", weight=0.9),
processing_templates.GreyWeight(band="green", weight=0.2),
],
)

Learn more


Last updated: