Giter Club home page Giter Club logo

easystac's Introduction

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 Point

geom = Point([-76.3,3.4])

E84_S2_L2A = (es.ImageCollection('sentinel-s2-l2a-cogs')
    .fromSTAC('https://earth-search.aws.element84.com/v0')
    .filterBounds(geom)
    .filterDate("2021-01-01","2022-01-01")
    .getInfo(resolution = 10,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.

easystac's People

Contributors

csaybar avatar davemlz avatar duckontheweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easystac's Issues

Runtime errors on Python 3.7

Thanks for this library, it fills a really interesting niche!

It looks like support for Python 3.7 was removed in 86a5a24, but the library can still be installed on that version of Python, leading to the following runtime error:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[<ipython-input-1-b49ba6bc5e87>](https://localhost:8080/#) in <module>()
      1 import leafmap
----> 2 import easystac as es
      3 from datetime import datetime

3 frames
[/usr/local/lib/python3.7/dist-packages/stackstac/rio_reader.py](https://localhost:8080/#) in <module>()
      5 import threading
      6 import weakref
----> 7 from typing import TYPE_CHECKING, Optional, Protocol, Tuple, Type, Union
      8 
      9 import numpy as np

ImportError: cannot import name 'Protocol' from 'typing' (/usr/lib/python3.7/typing.py)

If Python 3.7 is truly not supported, then it would probably be worth restricting the version of Python that this can be installed on in setup.py using python_requires. However, if the Python 3.7 compatibility issues are not too difficult to resolve it might be worth supporting that issue. I came across this when trying to use easystac in a Google Colab notebook, which runs 3.7, so it supporting 3.7 would make it easier to use in that environment.

I'm happy to put in a PR for either approach if you let me know which direction you would like to go.

Future of this package and relation with cubo

Thanks for a great set of libraries! I note that easystac was last updated an year ago and you have since released cubo with some overlap in functionality. What would you suggest w.r.t the future of easystac i.e. would you recommend using it or some other library?

thanks!
Ritvik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.