Overview

This section provides an overview of the API for ingesting and deleting data from a collection. It includes usage examples for many common scenarios.

MethodAPI ReferenceDescription
collection.deleteDeleting data pointsDelete data points from a collection.
collection.delete_idsDeleting data points by IDsDelete data points from a collection by their ids.

You need to have write permission on the collection to be able to ingest or delete datapoints.

Check out the examples below for common scenarios when ingesting and deleting data from collections. The examples assume you have already created a client and accessed a specific dataset collection that you have write permissions on.

from tilebox.datasets import Client

client = Client()
datasets = client.datasets()
collections = datasets.open_data.copernicus.sentinel1_sar.collections()
collection = collections["S1A_IW_RAW__0S"]

Ingesting data

Deleting data

To delete data from a collection, use the delete or delete_ids method.

One common way to delete data is to load it from a collection and then forward it to the delete method.

datapoints = collection.load(("2023-05-01", "2023-06-01"))

n_deleted = collection.delete(datapoints)
print(f"Deleted {n_deleted} data points.")
Output
Deleted 104 data points.

In case you already have the list of datapoint IDs that you want to delete, you can use the delete_ids method.

from uuid import UUID

datapoints_ids=[
  UUID("29b29ade-db02-427a-be9c-a8ef8184f544"),
  UUID("fa4a8e4e-6afe-41a3-b228-b867330669bd"),
]

n_deleted = collection.delete_ids(datapoints_ids)
print(f"Deleted {n_deleted} data points.")
Output
Deleted 2 data points.