Download USGS Landsat products with the Tilebox Landsat storage client, using Landsat 8 as an example.
Use this guide when you already have a Landsat datapoint from a Tilebox metadata query and want to access the product files behind it. The example uses Landsat 8 Collection 2 Level-2 surface reflectance data.Tilebox indexes Landsat metadata as datasets. Product files remain in the USGS public cloud archive, so file access uses the USGSLandsatStorageClient and your AWS requester-pays setup.
Start with a small metadata query and select one datapoint to access. For a deeper guide to open data discovery and metadata filtering, see Query open data metadata.
Create a USGSLandsatStorageClient. The client uses AWS credentials from your environment, such as AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN when needed.
Python
from tilebox.storage import USGSLandsatStorageClientstorage = USGSLandsatStorageClient()
Use download when you need the complete Landsat product directory. The storage client resolves the product location from the Tilebox datapoint metadata and downloads the matching files into the local cache.
Python
product_path = storage.download(selected)print(f"Downloaded {product_path.name} to {product_path}")print("Contents:")for path in product_path.iterdir(): print(f"- {path.relative_to(product_path)}")
Landsat products contain surface reflectance bands, quality masks, thermal bands, metadata, and preview images. Use list_objects and download_objects when you only need specific files.
Python
objects = storage.list_objects(selected)rgb_bands = ["B4", "B3", "B2"]rgb_objects = [ obj for obj in objects if any(obj.endswith(f"_{band}.TIF") for band in rgb_bands)]for obj in rgb_objects: print(obj)downloaded_files = storage.download_objects(selected, rgb_objects)print(downloaded_files)
Use this pattern when a workflow only needs a few bands, masks, or metadata files. It reduces transfer time and local storage compared with downloading the full product.
Many Landsat products include a thumbnail image. In a notebook, use quicklook to display the product preview without downloading the full product first.