Skip to main content

A Google Earth Engine-like Python package using Xarray and Dask

Project description

OpenGeo (og)

OpenGeo is a Python package designed to provide a Google Earth Engine-like experience using open-source geospatial tools such as Xarray, Dask, STAC, and GeoPandas. The goal is to smooth the transition for GEE users to the open Python ecosystem.

Features

  • API Familiarity: Mimics ee.Image, ee.ImageCollection, ee.FeatureCollection and ee.Geometry APIs.
  • Lazy Loading: Uses stackstac and dask to lazily load and process imagery from STAC catalogs.
  • Local Processing: Run your analysis locally or on a standard Dask cluster without GEE quotas.
  • Interoperability: Seamlessly integrate with xarray, geopandas, and shapely.

Installation

  1. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Install the package in editable mode:

    pip install -e .
    

Usage

import opengeo as og

# Initialize (optional, sets default STAC API)
og.Initialize()

# Create a region of interest
roi = og.Geometry.Rectangle(77.58, 12.96, 77.60, 12.98)

# Load an ImageCollection from a STAC ID (e.g., Sentinel-2 L2A)
col = og.ImageCollection("sentinel-2-l2a") \
    .filterDate("2023-01-01", "2023-01-31") \
    .filterBounds(roi) \
    .select(["red", "nir"])

# Compute a composite (mean)
image = col.mean()

# Calculate NDVI
ndvi = (image.select("nir") - image.select("red")) / (image.select("nir") + image.select("red"))

# Reduce over the region
stats = ndvi.reduceRegion(reducer="mean", geometry=roi, scale=10)
print(stats)

Comparisons

GEE OpenGeo Underlying Tech
ee.ImageCollection og.ImageCollection pystac_client + stackstac
ee.Image og.Image xarray.DataArray
ee.FeatureCollection og.FeatureCollection geopandas.GeoDataFrame
ee.Geometry og.Geometry shapely.geometry

Backend

OpenGeo defaults to using the Earth Search STAC API. You can change this via og.Initialize(url="...").

License

MIT

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

opengeo-0.0.1.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

opengeo-0.0.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opengeo-0.0.1.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for opengeo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 dec884da209ffdc8f35fe1c4764b0458e069762697a960d79379bb04d93ffbaf
MD5 f9f90d828da5ee5922e7be4b0aa5b780
BLAKE2b-256 20233029f6ccfb7ed0f8144e3123ff9d2b69350af6c4a29fb5b55c9ff666b2ce

See more details on using hashes here.

File details

Details for the file opengeo-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: opengeo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for opengeo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c774430f6bdbd1b9ba0a138f82d1eeecd3738701dcd0b27aeba5b03f91b1750c
MD5 ab25a239ba58ac65d5feb0727b7c2c4f
BLAKE2b-256 bb5b15c6977e5df89bdd85e7b3979fee3cf33c0a86838a02461e10717a88efc0

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