Skip to main content

A Python package for simple STAC queries

Project description

easystac

A Python package for simple STAC queries

PyPI conda-forge Documentation Status Tests License GitHub Sponsors Buy me a coffee Ko-fi Twitter Twitter Black isort


GitHub: https://github.com/cloudsen12/easystac

Documentation: https://easystac.readthedocs.io/

PyPI: https://pypi.org/project/easystac/

Conda-forge: https://anaconda.org/conda-forge/easystac


Overview

SpatioTemporal Asset Catalogs (STAC) provide a standardized format that describes geospatial information. Multiple platforms are using this standard to provide clients several datasets. Platforms such as Planetary Computer, Radiant ML Hub and Google Earth Engine use this standard, however, only Google Earth Engine provides a fully easy API that is transparent for clients.

easystac is a Python package that provides users of STAC objects as well as clients from Planetary Computer and Radiant ML Hub with an easy API that is transparent for them, implementing Google Earth Engine-like methods and classes to query, explore and convert STAC assets to xarray objects.

Some of the easystac features are listed here:

  • Simple authentication for Planetary Computer and Radiant ML Hub.
  • Access to STAC collections from Planetary Computer and Radiant ML Hub.
  • Earth Engine-like classes such as ImageCollection, including filtering methods.
  • Compatibility with xarray.

Check the simple usage of easystac here:

import easystac as es
from geojson import Polygon

geom = Polygon([
        [
            [-122.1553, 38.7578],
            [-121.8321, 39.7444],
            [-123.0002, 39.7503],
            [-123.0002, 38.7609],
            [-122.1553, 38.7578]
        ]
    ]
)

HLSS30 = (es.ImageCollection("HLSS30.v2.0")
    .fromSTAC("https://cmr.earthdata.nasa.gov/stac/LPCLOUD/")
    .filterBounds(geom)
    .filterDate("2021-01-01","2022-01-01")
    .getInfo(epsg = 4326,resolution = 0.0001,assets = ["B02","B03","B04"]))

In the case of specialized STAC objects, we have created special modules for Planetary Computer:

import easystac.planetary as pc
from geojson import Point

pc.Authenticate()
pc.Initialize()

geom = Point([-76.1,4.3])

S2 = (pc.ImageCollection("sentinel-2-l2a")
    .filterBounds(geom)
    .filterDate("2020-01-01","2021-01-01")
    .getInfo(resolution = 10))

This principle applies also for Radiant ML Hub.

import easystac.radiant as rd

rd.Authenticate()
rd.Initialize()

S1floods = (rd.ImageCollection("sen12floods_s1_source")
    .filterDate("2019-01-01","2019-01-05")
    .getInfo(epsg = 4326,resolution = 0.0001))

Installation

Install the latest version from PyPI:

pip install easystac

Upgrade easystac by running:

pip install -U easystac

Install the latest version from conda-forge:

conda install -c conda-forge easystac

Install the latest dev version from GitHub by running:

pip install git+https://github.com/cloudsen12/easystac

License

The project is licensed under the MIT license.

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

easystac-0.0.1.tar.gz (9.1 kB view details)

Uploaded Source

File details

Details for the file easystac-0.0.1.tar.gz.

File metadata

  • Download URL: easystac-0.0.1.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

File hashes

Hashes for easystac-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9c2f962098f8db1c543e5141ecdb0ea7cecf79a24a9abd8f0946c14da16e5bf3
MD5 7a2398dac94754859bfff5f705eb8402
BLAKE2b-256 31704ef4a11343fe297951d6680f2f68a05f7058824a0f111e2410818abe1618

See more details on using hashes here.

Supported by

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