All Projects → KMarkert → restee

KMarkert / restee

Licence: MIT License
Python package to call processed EE objects via the REST API to local data

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to restee

spyndex
Awesome Spectral Indices in Python.
Stars: ✭ 56 (+115.38%)
Mutual labels:  xarray, earth-engine
wxee
A Python interface between Earth Engine and xarray for processing time series data
Stars: ✭ 113 (+334.62%)
Mutual labels:  xarray, earth-engine
eemont
A python package that extends Google Earth Engine.
Stars: ✭ 290 (+1015.38%)
Mutual labels:  earth-engine
goes2go
Download and process GOES-16 and GOES-17 data from NOAA's archive on AWS using Python.
Stars: ✭ 77 (+196.15%)
Mutual labels:  xarray
esmlab
Earth System Model Lab (esmlab). ⚠️⚠️ ESMLab functionality has been moved into <https://github.com/NCAR/geocat-comp>. ⚠️⚠️
Stars: ✭ 23 (-11.54%)
Mutual labels:  xarray
CoastSat.slope
Beach-face slope estimation from satellite-derived shorelines, extension of the CoastSat toolbox.
Stars: ✭ 42 (+61.54%)
Mutual labels:  earth-engine
clisops
Climate Simulation Operations
Stars: ✭ 17 (-34.62%)
Mutual labels:  xarray
aospy
Python package for automated analysis and management of gridded climate data
Stars: ✭ 80 (+207.69%)
Mutual labels:  xarray
climate system
Notes and practicals for my "Physics of the Climate System" lecture
Stars: ✭ 13 (-50%)
Mutual labels:  xarray
GEOSChem-python-tutorial
Python/xarray tutorial for GEOS-Chem users
Stars: ✭ 64 (+146.15%)
Mutual labels:  xarray
ee extra
A ninja python package that unifies the Google Earth Engine ecosystem.
Stars: ✭ 42 (+61.54%)
Mutual labels:  earth-engine
awesome-spectral-indices
A ready-to-use curated list of Spectral Indices for Remote Sensing applications.
Stars: ✭ 357 (+1273.08%)
Mutual labels:  earth-engine
awesome-earth-engine-apps
A collection of all public Google Earth Engine Apps.
Stars: ✭ 78 (+200%)
Mutual labels:  earth-engine
geeSharp.js
Pan-sharpening in the Earth Engine code editor
Stars: ✭ 25 (-3.85%)
Mutual labels:  earth-engine
earthengine-py-examples
A collection of 300+ examples for using Earth Engine and the geemap Python package
Stars: ✭ 76 (+192.31%)
Mutual labels:  earth-engine
GeoUtils
Class-based handling of georeferenced raster and vector data
Stars: ✭ 32 (+23.08%)
Mutual labels:  geospatial-processing
wax-ml
A Python library for machine-learning and feedback loops on streaming data
Stars: ✭ 36 (+38.46%)
Mutual labels:  xarray
spectral
Awesome Spectral Indices for the Google Earth Engine JavaScript API (Code Editor).
Stars: ✭ 68 (+161.54%)
Mutual labels:  earth-engine
CRC4Docker
Python scripts for the textbook "Image Analysis, Classification and Change Detection in Remote Sensing, Fourth Revised Edition"
Stars: ✭ 84 (+223.08%)
Mutual labels:  earth-engine
cartoee
Publication quality maps using Earth Engine and Cartopy
Stars: ✭ 38 (+46.15%)
Mutual labels:  earth-engine

restee

Python package to call process EE objects via the REST API to local data

PyPI version docs License: MIT

restee is a package that aims to make plugging Earth Engine (EE) computations into downstream Python processing easier. The EE REST API allows user to interface with EE using REST API calls that allow for . There are many more features to the EE REST API, however, restee aims to simply provide a user-friendly means to access computed server-side objects (like image data) from the Python earthengine-api API to a local Python enviroment (client-side).

It should be noted that restee relies on fairly new and advanced EE features that may not be suitable for all users (see warning from the EE team). If you are new to Earth Engine, please get started with the JavaScript guide.

Installation

restee relies heavily on the geospatial Python ecosystem to manage different geospatial data formats and execute geospatial processes. It is recommended to use conda to handle the package dependencies and create a virtual environment. To do this run the following command:

conda create -n restee -c conda-forge -y \
    python>=3.6 \
    numpy \
    scipy \
    pandas \
    xarray \
    rasterio \
    geopandas \
    pyproj \
    requests \
    backoff \
    earthengine-api \
    tqdm

Once all of the dependencies are installed, the restee package can be installed using pip:

pip install restee

It is strongly recommended to read the Installation documentation

Getting Started

This section is meant purely as a demonstration of what is possible, please see the Installation page for how to install package and setup the authentication then the Usage page for in depth information.

import ee
ee.Initialize()

import restee as ree

# get an authenticated session with GCP for REST API calls
session = ree.EESession("<CLOUD-PROJECT>","<PATH-TO-SECRET-KEY>")

# use ee to get a featurecollection for USA
countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017")
camerica= countries.filter(ee.Filter.eq("wld_rgn", "Central America"))

# define the domain imagery will be requested for
# in this case it is the computed USA featurecollection
domain = ree.Domain.from_ee_geometry(session,camerica,resolution=0.01)

# define some computations
# here we calculate median NDVI for the summer months over the USA
modis = (
    ee.ImageCollection("MODIS/006/MOD09GA")
    .filterDate("2020-06-01","2020-09-01")
    .map(lambda x: x.normalizedDifference(["sur_refl_b02","sur_refl_b01"]))
    .median()
    .rename("NDVI")
)

# request the ee.Image pixels as a xarray dataset
ndvi_ds = ree.img_to_xarray(session,domain,modis,no_data_value=0)

# inspect the local xarray Dataset object
ndvi_ds

# output
# <xarray.Dataset>
# Dimensions:  (lat: 1130, lon: 1509)
# Coordinates:
#   * lon      (lon) float64 -92.23 -92.22 -92.21 -92.2 ... -77.17 -77.16 -77.15
#   * lat      (lat) float64 18.48 18.47 18.46 18.45 ... 7.225 7.215 7.205 7.195
# Data variables:
#     NDVI     (lat, lon) float32 nan nan nan nan nan nan ... nan nan nan nan nan

From this point on the computed data is local to your system so you can do with it what you want. This allows the data to be plotted, persisted, or fed into another downstream process. For the sake of example, here we will plot the result.

ndvi_ds.NDVI.plot(robust=True,cmap="viridis")

MODIS Summer NDVI

Again, this quick example was to highlight how a user may define an EE computation using the earthengine-api and request the data into a local data structure. One may use restee to get zonal statitics calculated for feature collections or even explore collection metadata, any format on EE can be requested locally. For more details, please see the Usage page.

Get in touch

Please report any bugs, ask questions, or suggest new features on GitHub.

Contribute

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

License

restee is available under the open source MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].