Skip to main content

Create EO Minicubes from Polygons and simplify EO Data downloading.

Project description

Terragon

Terragon - Earth(Poly)gon. Create EO Minicubes from Polygons and simplify EO Data downloading.

Documentation GitHub

PyPI License

You want to download Earth Observation data but don't want to spend hours just for accessing all different APIs? Then this is for you!

We currently support these data providers:

Usage

Installation

Install the package via PyPi:

pip install "terragon-downloader"

Optional with the dependency you want to use:

pip install "terragon-downloader[pc]"

Downloading EO data

import terragon
import geopandas as gpd
from shapely.geometry import Polygon

# example polygon
gdf = gpd.GeoDataFrame(geometry=[Polygon(
            [(446993, 3383569),
            (446993, 3371569),
            (434993, 3371569),
            (434993, 3383569),
            (446993, 3383569)])],
            crs='EPSG:32616' # the dataset will receive the crs from the dataframe
            )

# initialize backend/data source (here planetary computer)
tg = terragon.init('pc')

# download data
da = tg.create(shp=gdf, # polygon in geopandas format (minicube will receive the same CRS)
               collection="sentinel-2-l2a", # name of the collection
               start_date="2021-01-01", # start date of tiles
               end_date="2021-01-05", # end date of tiles
               bands=["B02", "B03", "B04"], # bands to retrieve
               resolution=20, # pixel size in meter
               )

Other data backends work with the same principle, some may require an account, check out the Demos.

Limitations

Users must provide authentication (if required) for the data providers to Terragon and must comply with their licensing agreements. Instructions on how to create accounts and the necessary information for each data provider can be found in the Demos.

This library relies on external data providers. Therefore, the reproducibility cannot be guaranteed and depends on the providers. Users should ensure they check the relevant license terms for data and services and cite them appropriately. The data offered may also vary across providers. It is important to note that each provider operates independently and utilizes different processing pipelines. This can result in various products that may not be compatible with one another, even if their collections share a similar name on the platforms of the data providers. Additionally, certain data or patches may be available from some providers but not from others. This includes mosaicking, which depends on the chosen collection and is not handled by this library.

Contribute

You found a bug or a data source is missing? We encourage you to raise an issue or provide a PR. For details, please see the contributing guideline.

We are looking for contributors to add more collections to CDSE. Please get in touch if you are interested.

License

This work is licensed under the MIT license.

Citation

If you use this work, please consider citing the following paper: Coming soon.

Acknowledgement

This work is inspired by cubo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terragon_downloader-0.3.0.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terragon_downloader-0.3.0-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file terragon_downloader-0.3.0.tar.gz.

File metadata

  • Download URL: terragon_downloader-0.3.0.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for terragon_downloader-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a64203a03c7c21ef96edff7c92920a2661afb2329e7740c401fd9af353522a6e
MD5 af6b176683095f9a6ab3598165f73d21
BLAKE2b-256 3518759fc842d79d6b927493dd3b3e3e87d3ac27528ece46aa26ea66bf985d67

See more details on using hashes here.

File details

Details for the file terragon_downloader-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for terragon_downloader-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebfda5e03828701a6f311708a20755b88d091bf416cff0b0d40ba8628228779d
MD5 42075c86e4429271da2db5e7ed4f6790
BLAKE2b-256 69454f649cf35c939cef194fa268130b12a9c173df7f8df934aa1cf4e08adf6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page