Glossary in SDK

Choose data offerings from the glossary using the SDK.


Overview

The glossary provides information on UP42 data offerings. It helps you create orders.

Collections serve as the higher-level category, containing one or more data products related to the actual configuration of data available for ordering.

View repository

Class: CollectionType

An enumeration class that defines types of geospatial collections.

Constants

ConstantDescriptionValue
ARCHIVEstr
A catalog collection.
ARCHIVE
TASKINGstr
A tasking collection.
TASKING
Python
# Fetch collections
tasking_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by=up42.CollectionSorting.name.asc,
)
)
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
# Define output
9 collapsed lines
print(f"Tasking collections")
for collection in tasking_collections:
print(f" {collection.title}: {collection.name}")
print(f" {collection.description}\n")
print(f"Catalog collections")
for collection in archive_collections:
print(f" {collection.title}: {collection.name}")
print(f" {collection.description}\n")

Class: ResolutionValue

A data class that represents the resolution of data within a collection.

Attributes

AttributeDescription
minimumfloat
The best possible resolution available for the collection, in meters.
descriptionOptional[str]
A description of the resolution.
maximumOptional[float]
The least detailed resolution available for the collection, in meters. The parameter is omitted if the collection has only one resolution value, specified in minimum.
Python
# Fetch collections
15 collapsed lines
tasking_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by=up42.CollectionSorting.name.asc,
)
)
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
all_collections = tasking_collections + archive_collections
# Define output
for collection in all_collections:
print("=" * 60)
print(f"Title: {collection.title}")
print(f"Name: {collection.name}")
metadata = collection.metadata
print("\nMetadata:")
print(f" - Product type: {metadata.product_type}")
print(f" - Resolution class: {metadata.resolution_class}")
print(f" - Min resolution: {metadata.resolution_value.minimum} m")
if metadata.resolution_value.maximum:
print(f" - Max resolution: {metadata.resolution_value.maximum} m")

Class: CollectionMetadata

A data class that contains metadata related to a collection.

Attributes

AttributeDescription
product_typeOptional[Literal[“OPTICAL”, “SAR”, “ELEVATION”]]
The type of product the collection delivers.
resolution_classOptional[Literal[“VERY_HIGH”, “HIGH”, “MEDIUM”, “LOW”]]
The spatial resolution class.
resolution_valueOptional[ResolutionValue]
The level of detail achievable for the collection.
Python
# Fetch collections
15 collapsed lines
tasking_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by=up42.CollectionSorting.name.asc,
)
)
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
all_collections = tasking_collections + archive_collections
# Define output
for collection in all_collections:
print("=" * 60)
print(f"Title: {collection.title}")
print(f"Name: {collection.name}")
metadata = collection.metadata
print("\nMetadata:")
print(f" - Product type: {metadata.product_type}")
print(f" - Resolution class: {metadata.resolution_class}")
print(f" - Min resolution: {metadata.resolution_value.minimum} m")
if metadata.resolution_value.maximum:
print(f" - Max resolution: {metadata.resolution_value.maximum} m")

Class: Scene

A data class that represents a scene in the system.

Attributes

AttributeDescription
idstr
The scene ID.
bboxOptional[BoundingBox]
The bounding box.
geometryUnion[geojson.Polygon, geojson.MultiPolygon]
The geometry in the GeoJSON format.
datetimeOptional[str]
The date and time when the sensor acquired the data.
start_datetimeOptional[str]
The date and time when the sensor started the acquisition process.
end_datetimeOptional[str]
The date and time when the sensor finished the acquisition process.
constellationstr
The name of the sensor.
collectionstr
The name of the collection.
cloud_coverageOptional[float]
The percentage of cloud coverage.
resolutionOptional[float]
The spatial resolution, in meters.
delivery_timeOptional[Literal[“MINUTES”, “HOURS”, “DAYS”]]
The unit of data delivery time.
producerstr
The name of the producer. Data producers are companies that initially acquired and processed the source data. Data acquired by a producer can be distributed to various hosts.
quicklookutils.ImageFile
The quicklook file. Quicklooks are low-resolution scene previews.
Python
# Select the host
host = "oneatlas"
# Fetch catalog collections
17 collapsed lines
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
# Find the provider instance matching the selected host name that is marked as a host
host_provider = next(
(
p
for c in archive_collections
for p in c.providers
if p.name == host and getattr(p, "is_host", False)
),
None,
)
# Define search 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)])
# Search for scenes using the host
scenes = list(
host_provider.search(
collections=["SPOT", "phr"],
intersects=geometry,
start_date="2022-06-01",
end_date="2022-12-31",
query={"cloudCoverage": {"LT": 20}},
)
)
# Define output, return found scenes and their details
for scene in scenes:
print("=" * 60)
print(f"- Scene ID: {scene.id}")
print(f" Bounding box: {scene.bbox}")
print(f" Geometry: {scene.geometry}")
print(f" Acquisition date and time: {scene.datetime}")
print(f" Acquisition start: {scene.start_datetime}")
print(f" Acquisition end: {scene.end_datetime}")
print(f" Constellation: {scene.constellation}")
print(f" Collection: {scene.collection}")
print(f" Cloud coverage: {scene.cloud_coverage}%")
print(f" Resolution: {scene.resolution} m")
print(f" Delivery time: {scene.delivery_time}")
print(f" Producer: {scene.producer}")
print(f" Quicklook: {scene.quicklook}")

Class: Provider

A data class that represents a provider in the system.

Attributes

AttributeDescription
namestr
The name of the provider.
titlestr
The title of the provider.
descriptionstr
The description of the provider.
roleslist[Literal[“PRODUCER”, “HOST”]]
Provider roles:
  • PRODUCER: A provider that initially acquired and processed the source data. Data acquired by a producer can be distributed to various hosts.
  • HOST: A provider that offers access to data acquired by a producer.
Python
# Fetch catalog collections
6 collapsed lines
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
# Define output, return hosts and producers by collection
for collection in archive_collections:
print("=" * 60)
print(f"Title: {collection.title}")
print(f"Name: {collection.name}")
print("Providers:")
for provider in collection.providers:
print(f" - {provider.name} ({', '.join(provider.roles)})")

Properties

is_host

Checks if the provider has the HOST role. Returns bool.

Python
# Fetch catalog collections
6 collapsed lines
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
# Define output, return only providers who are hosts
for collection in archive_collections:
print("=" * 60)
print(f"Title: {collection.title}")
print(f"Name: {collection.name}")
for provider in collection.providers:
if getattr(provider, "is_host", False):
print(f"Host: {provider.name}")

Methods

Searches the catalog and retrieves scenes. Returns Iterator[Scene]. Use itertools.islice to offset and limit the results.

ParameterDescription
bboxOptional[BoundingBox]
A search geometry in the GeoJSON format. Returns images that intersect with the defined rectangle and may not fully cover it. Use only if intersects isn’t specified.
intersectsOptional[geojson.Polygon]
A polygon in the GeoJSON format.
start_dateOptional[str]
Search for full scenes that were acquired after the given start date, in the YYYY-MM-DD format.
end_dateOptional[str]
Search for full scenes that were acquired before the given end date, in the YYYY-MM-DD format.
queryOptional[dict]
A STAC query object.
collectionsOptional[list[str]]
The names of the collections whose full scenes you want to include in search results.
Python
import pandas as pd
# Select the host
host = "oneatlas"
# Fetch catalog collections
9 collapsed lines
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
# Find the provider instance matching the selected host name that is marked as a host
host_provider = next((p for c in archive_collections for p in c.providers if p.name == host and getattr(p, "is_host", False)), None)
# Define search 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)])
# Search for scenes using the host
scenes = list(host_provider.search(
collections=["SPOT", "phr"],
intersects=geometry,
start_date="2022-06-01",
end_date="2022-12-31",
query={
"cloudCoverage": {"LT": 20}
}
))
# Define output, return found scenes and their details
print(f"Found {len(scenes)} scenes matching the criteria.")
scene_ids = [scene.id for scene in scenes]
# Display the table
df = pd.DataFrame(scene_ids, columns=["Scene ID"])
display(df)

Class: DataProduct

A data class that represents a data product in the system.

Attributes

AttributeDescription
namestr
The data product name.
titlestr
The title of the data product.
descriptionstr
The description of the data product.
idOptional[str]
The data product ID.
eula_idOptional[str]
The EULA ID.
Python
from dataclasses import asdict
# Fetch collections
15 collapsed lines
tasking_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by=up42.CollectionSorting.name.asc,
)
)
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
all_collections = tasking_collections + archive_collections
# Define output
def print_product_info(product):
info = asdict(product)
description = info.get('description', '').replace('\n', '\\n')
print(f"Name: {info.get('name', '')}")
print(f"Title: {info.get('title', '')}")
print(f"Description: {description}")
print(f"ID: {info.get('id', '')}")
print(f"EULA ID: {info.get('eula_id', '')}\n")
# Print information for all data products
for collection in all_collections:
for product in collection.data_products:
print_product_info(product)

Properties

schema

Retrieves the schema of the data product. Returns Optional[dict].

Python
# Select a data product
data_product_name="sentinel-2-level-2a"
# Fetch collections
15 collapsed lines
tasking_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by=up42.CollectionSorting.name.asc,
)
)
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
all_collections = tasking_collections + archive_collections
# Create a dictionary of all data product names and their schemas
product_schemas = {
product.name: product.schema
for collection in all_collections
for product in collection.data_products
}
# Look up the schema for the selected data product
schema = product_schemas.get(data_product_name)
schema

Class: Collection

A data class that represents a collection in the system.

Attributes

AttributeDescription
namestr
The name of the collection.
titlestr
The title of the collection.
descriptionstr
The description of the collection.
typeCollectionType
The type of the collection.
integrationslist[IntegrationValue]
Integration values.
providerslist[Provider]
Providers.
data_productslist[DataProduct]
Data products.
metadataOptional[CollectionMetadata]
The collection metadata.
Python
# Fetch collections
15 collapsed lines
tasking_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by=up42.CollectionSorting.name.asc,
)
)
archive_collections = list(
up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by=up42.CollectionSorting.name.asc,
)
)
all_collections = tasking_collections + archive_collections
# Define output
for collection in all_collections:
print("=" * 60)
print(f"Title: {collection.title}")
print(f"Name: {collection.name}")
print(f"Description: {collection.description}")
print(f"Type: {collection.type.value}")
print("\nIntegrations:")
for integration in collection.integrations:
print(f" - {integration}")
print("\nProviders:")
for provider in collection.providers:
print(f" - {provider.name} ({', '.join(provider.roles)})")
print("\nData products:")
for product in collection.data_products:
print(f" - Title: {product.title}")
print(f" Name: {product.name}")
print(f" ID: {product.id}")
metadata = collection.metadata
print("\nMetadata:")
print(f" - Product type: {metadata.product_type}")
print(f" - Resolution class: {metadata.resolution_class}")
print(f" - Min resolution: {metadata.resolution_value.minimum} m")
if metadata.resolution_value.maximum:
print(f" - Max resolution: {metadata.resolution_value.maximum} m")

Class: CollectionSorting

A class that contains predefined sorting fields.

Attributes

AttributeDescription
nameutils.SortingField
Sorts by collection name. The default order is ascending.
titleutils.SortingField
Sorts by collection title. The default order is ascending.
descriptionutils.SortingField
Sorts by collection description. The default order is ascending.
typeutils.SortingField
Sorts by collection type. The default order is ascending.
Python
glossary = up42.glossary.ProductGlossary
tasking_collections = glossary.get_collections(
collection_type = up42.glossary.CollectionType.TASKING,
sort_by = up42.glossary.CollectionSorting.name.asc,
)
for collection in tasking_collections:
print(f"{collection.name}")

Class: ProductGlossary

A data class that represents product glossary in the system.

Methods

get_collections

Retrieves a list of geospatial collections. Returns Iterator[Collection]. Use itertools.islice to offset and limit the results.

ParameterDescription
collection_typeOptional[CollectionType]
The type of the collection.
sort_byOptional[utils.SortingField]
The results sorting method that arranges elements in ascending or descending order based on a chosen field.
Python
# Fetch collections
tasking_collections = list(up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.TASKING,
sort_by = up42.CollectionSorting.name.asc,
))
archive_collections = list(up42.ProductGlossary.get_collections(
collection_type=up42.CollectionType.ARCHIVE,
sort_by = up42.CollectionSorting.name.asc,
))
# Define output
9 collapsed lines
print(f"Tasking collections")
for collection in tasking_collections:
print(f" {collection.title}: {collection.name}")
print(f" {collection.description}\n")
print(f"Catalog collections")
for collection in archive_collections:
print(f" {collection.title}: {collection.name}")
print(f" {collection.description}\n")

Learn more


Last updated: