If you already know the ID of the data point you want to query, you can query it directly, using
Collection.find in Python or Datapoints.GetInto in Go.
datapoint_id = "0197a491-1520-102f-48f4-f087d6ef8603"
datapoint = collection.find(datapoint_id)
print(datapoint)
Output
<xarray.Dataset> Size: 443B
Dimensions: ()
Coordinates:
time datetime64[ns] 8B 2025-06-25T00:51:01.024000
Data variables: (12/23)
id <U36 144B '0197a491-1520-102f-48f4-f087d6ef8603'
ingestion_time datetime64[ns] 8B 2025-06-25T05:33:11.104000
geometry object 8B POLYGON ((156.090908 48.709728, 155.7188...
granule_name object 8B 'S2A_MSIL2A_20250625T005101_N0511_R045_T...
processing_level uint8 1B 5
product_type object 8B 'S2MSI2A'
... ...
thumbnail object 8B 'https://catalogue.dataspace.copernicus....
cloud_cover float64 8B 87.38
resolution int64 8B 0
flight_direction uint8 1B 2
acquisition_mode uint8 1B 20
mission_take_id object 8B 'GS2A_20250625T005101_052266_N05.11'
You can also set the skip_data
parameter when calling find
to query only the required fields of the data point, same as for query
.
Checking if a datapoint exists
find
returns an error if the specified datapoint does not exist. You can use this to check if a datapoint exists or not.
from tilebox.datasets.sync.dataset import NotFoundError
datapoint_id = "0197a47f-a830-1160-6df5-61ac723dae17" # doesn't exist
try:
collection.find(datapoint_id)
exists = True
except NotFoundError:
exists = False