Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b4ec234
Add ability to open ee.Image objects
tylere Nov 16, 2024
afaa9c5
End docstring with punctuation
tylere Nov 18, 2024
c2e2a9f
Expose __version__ as module attribute
tylere Jan 2, 2025
fd9e20a
Add install docs
jdbcode Jan 7, 2025
5fac43a
Account for mask byte in chunk size calculation
jdbcode Jan 7, 2025
3c34816
ignore temp directory
tylere Feb 3, 2025
4ba0259
Merge branch 'main' into simplify_proj_params
tylere Feb 3, 2025
c107bca
Add pixi config files
tylere Feb 3, 2025
0dbd250
limit to python<3.13; add proj, gdal as dependencies
tylere Feb 3, 2025
fd2b255
Use grid params (crs, crs_transform, shape_2d)
tylere Feb 26, 2025
2cda1b9
Merge branch 'simplify_proj_params' into simplify_proj_params
tylere Feb 26, 2025
dab7297
Remove helper placeholders
tylere Feb 28, 2025
68d7a46
Update README code and add tests
tylere Mar 1, 2025
97a3814
Double to single quotes.
tylere Mar 11, 2025
c4da199
Remove unnecessary import and print
tylere Mar 11, 2025
4566716
Clean up TransformType type definition
tylere Mar 11, 2025
5b5a75f
Add type hints.
tylere Mar 11, 2025
6419d93
Revert .gitattributes change
tylere Mar 11, 2025
b52f630
Revert .gitignore changes
tylere Mar 11, 2025
82407de
Revert .vscode/settings.json
tylere Mar 11, 2025
3044fce
Remove pixi config
tylere Mar 17, 2025
0228871
Remove extra print statement
tylere Mar 18, 2025
9770fae
Change strings from double to single quotes
tylere Mar 18, 2025
68c1905
Switch back to double quotes to enclose single quote
tylere Mar 18, 2025
d661309
Remove match/case syntax
tylere Mar 18, 2025
addc823
refactor: Use `affine` directly instead of `rasterio.transform.Affine`
jdbcode Sep 25, 2025
4c0a799
refactor: Make `shapely` a require dependency
jdbcode Sep 25, 2025
e32843e
refactor: Add support for accepting `affine.Affine` object as `crs_tr…
jdbcode Sep 26, 2025
1d866b8
refactor: Make `crs_transform` an attribute of `self` for reuse
jdbcode Sep 26, 2025
cf48661
fix: Handle negative and positive y scale in `fit_geometry`
jdbcode Sep 26, 2025
0a54b45
fix: Fix tests so that tuple is used (requried type for crs_transform…
jdbcode Sep 26, 2025
c215fac
refactor: Update readme to use tuple for shape and transform, add det…
jdbcode Sep 29, 2025
a9ab143
Merge pull request #225 from tylere/simplify_proj_params
naschmitz Oct 6, 2025
72f81cb
Merge remote-tracking branch 'origin/main' into simplify_pixel_grid_p…
jdbcode Oct 7, 2025
edde469
`pyupgrade --py39-plus` following commit 625cbba
jdbcode Oct 7, 2025
0daf958
Drop Python 3.8 following commit 34adc13
jdbcode Oct 7, 2025
ca9691a
Fix additional typing that pyupgrade missed (?)
jdbcode Oct 7, 2025
55bb162
Change dimension ordering from (time, x, y) to (time, y, x) (#274)
jdbcode Nov 12, 2025
be0df9d
Update examples to new API for grid parameters and remove unnecessary…
jdbcode Nov 12, 2025
2f7952b
Update and improve docs
jdbcode Nov 13, 2025
367ff76
Update documentation for breaking changes in v0.1.0 and migration guide
jdbcode Nov 13, 2025
a9b14f0
Refactor breaking change notice in README files for GH MD format
jdbcode Nov 13, 2025
1f251ce
Fix formatting of breaking change notice in documentation
jdbcode Nov 13, 2025
d84b103
Update Sphinx configuration for improved navigation and remove migrat…
jdbcode Nov 13, 2025
a9ab5ec
Drop Python version support for 3.9 and 3.10
jdbcode Nov 15, 2025
41c33c2
Update contributing guidelines to include test running instructions
jdbcode Nov 17, 2025
7cecc13
Merge branch 'main' into simplify_pixel_grid_params
jdbcode Nov 22, 2025
ca2c03c
Fix mangled conflict resolution
jdbcode Nov 22, 2025
b126dbb
Ran pyink to format files to pass lint checks
jdbcode Nov 22, 2025
07c2323
[fix comments] README.md
jdbcode Nov 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
fail-fast: false
matrix:
python-version: [
"3.10",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great that 3.9 is out, but 3.10? I see it documented in the PR description, but we still need to support 3.10 in ee and geemap until 2026-10.

https://devguide.python.org/versions/

"3.11",
"3.12",
"3.13",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
python-version: "3.11"
- uses: actions/download-artifact@v4
with:
name: releases
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ cython_debug/
.DS_Store

# pixi environments
.pixi
.pixi
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
171 changes: 44 additions & 127 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,165 +1,82 @@
> **⚠️ Breaking Change in v0.1.0**
>
> A major refactor was released in v0.1.0, introducing breaking changes to the Xee API. In most cases, existing code written for pre-v0.1.0 versions will require updates to remain compatible.
>
> - See the [Migration Guide](docs/migration-guide-v0.1.0.md) for details on updating your code.
> - If you need more time to migrate, you can pin your environment to the latest pre-v0.1.0 release.

# Xee: Xarray + Google Earth Engine

![Xee Logo](https://raw.githubusercontent.com/google/Xee/main/docs/xee-logo.png)

_An Xarray extension for Google Earth Engine._
Xee is an Xarray backend for Google Earth Engine. Open `ee.Image` / `ee.ImageCollection` objects as lazy `xarray.Dataset`s and analyze petabyte‑scale Earth data with the scientific Python stack.

[![image](https://img.shields.io/pypi/v/xee.svg)](https://pypi.python.org/pypi/xee)
[![image](https://static.pepy.tech/badge/xee)](https://pepy.tech/project/xee)
[![Conda
Recipe](https://img.shields.io/badge/recipe-xee-green.svg)](https://github.com/conda-forge/xee-feedstock)
[![Conda Recipe](https://img.shields.io/badge/recipe-xee-green.svg)](https://github.com/conda-forge/xee-feedstock)
[![image](https://img.shields.io/conda/vn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)
[![Conda
Downloads](https://img.shields.io/conda/dn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)

## How to use
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/xee.svg)](https://anaconda.org/conda-forge/xee)

Install with pip:
## Install

```shell
```bash
pip install --upgrade xee
```

Install with conda:
or

```shell
```bash
conda install -c conda-forge xee
```

Then, authenticate Earth Engine:

```shell
earthengine authenticate --quiet
```

Now, in your Python environment, make the following imports:
## Minimal example

```python
import ee
import xarray
```

Next, specify your EE-registered cloud project ID and initialize the EE client
with the high volume API:

```python
ee.Initialize(
project='my-project-id'
opt_url='https://earthengine-highvolume.googleapis.com')
```

Open any Earth Engine ImageCollection by specifying the Xarray engine as `'ee'`:

```python
ds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee')
```

Open all bands in a specific projection (not the Xee default):

```python
ds = xarray.open_dataset('ee://ECMWF/ERA5_LAND/HOURLY', engine='ee',
crs='EPSG:4326', scale=0.25)
```

Open an ImageCollection (maybe, with EE-side filtering or processing):

```python
ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate(
'1992-10-05', '1993-03-31')
ds = xarray.open_dataset(ic, engine='ee', crs='EPSG:4326', scale=0.25)
```

Open an ImageCollection with a specific EE projection or geometry:

```python
ic = ee.ImageCollection('ECMWF/ERA5_LAND/HOURLY').filterDate(
'1992-10-05', '1993-03-31')
leg1 = ee.Geometry.Rectangle(113.33, -43.63, 153.56, -10.66)
ds = xarray.open_dataset(
ic,
engine='ee',
projection=ic.first().select(0).projection(),
geometry=leg1
)
```

Open multiple ImageCollections into one `xarray.Dataset`, all with the same
projection:
import xarray as xr
from xee import helpers

```python
ds = xarray.open_mfdataset(
['ee://ECMWF/ERA5_LAND/HOURLY', 'ee://NASA/GDDP-CMIP6'],
engine='ee', crs='EPSG:4326', scale=0.25)
```

Open a single Image by passing it to an ImageCollection:

```python
i = ee.ImageCollection(ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318'))
ds = xarray.open_dataset(i, engine='ee')
```
# Authenticate once (on a persistent machine):
# earthengine authenticate

Open any Earth Engine ImageCollection to match an existing transform:
project = 'PROJECT-ID' # Set your Earth Engine registered Google Cloud project ID
# Initialize (high‑volume endpoint recommended for reading stored collections)
ee.Initialize(project=project, opt_url='https://earthengine-highvolume.googleapis.com')

```python
raster = rioxarray.open_rasterio(...) # assume crs + transform is set
ds = xr.open_dataset(
'ee://ECMWF/ERA5_LAND/HOURLY',
engine='ee',
geometry=tuple(raster.rio.bounds()), # must be in EPSG:4326
projection=ee.Projection(
crs=str(raster.rio.crs), transform=raster.rio.transform()[:6]
),
)
# Open a dataset by matching its native grid
ic = ee.ImageCollection('ECMWF/ERA5_LAND/MONTHLY_AGGR')
grid = helpers.extract_grid_params(ic)
ds = xr.open_dataset(ic, engine='ee', **grid)
print(ds)
```

See [examples](https://github.com/google/Xee/tree/main/examples) or
[docs](https://github.com/google/Xee/tree/main/docs) for more uses and
integrations.

## Getting help
Next steps:

If you encounter issues using Xee, you can:
- Quickstart: docs/quickstart.md
- Concepts (grid params, CRS, orientation): docs/concepts.md
- User Guide (workflows): docs/user-guide.md

1. Open a new or add to an existing [Xee discussion
topic](https://github.com/google/Xee/discussions)
2. Open an [Xee issue](https://github.com/google/Xee/issues). To increase the
likelihood of the issue being resolved, use this [template Colab
notebook](https://colab.research.google.com/drive/1vAgfAPhKGJd4G9ZUOzciqZ7MbqJjlMLR)
to create a reproducible script.
## Features

## How to run integration tests
- Lazy, parallel pixel retrieval through Earth Engine
- Flexible output grid definition (fixed resolution or fixed shape)
- CF-friendly dimension order: `[time, y, x]`
- Plays nicely with Xarray, Dask, and friends

The Xee integration tests only pass on Xee branches (no forks). Please run the
integration tests locally before sending a PR. To run the tests locally,
authenticate using `earthengine authenticate` and run the following:
## Community & Support

```bash
python -m unittest xee/ext_integration_test.py
```
- Discussions: https://github.com/google/Xee/discussions
- Issues: https://github.com/google/Xee/issues

or
## Contributing

```bash
python -m pytest xee/ext_integration_test.py
```
See docs/contributing.md and sign the required CLA.

## License

This is not an official Google product.

```
Copyright 2023 Google LLC
[Apache 2.0](LICENSE)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
`SPDX-License-Identifier: Apache-2.0`

https://www.apache.org/licenses/LICENSE-2.0
This is not an official Google product.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
1 change: 0 additions & 1 deletion docs/README.md

This file was deleted.

32 changes: 32 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Xee Documentation (source files)

> **⚠️ Breaking Change in v0.1.0**
>
> A major refactor was released in v0.1.0, introducing breaking changes to the Xee API. In most cases, existing code written for pre-v0.1.0 versions will require updates to remain compatible.
>
> - See the [Migration Guide](migration-guide-v0.1.0.md) for details on updating your code.
> - If you need more time to migrate, you can pin your environment to the latest pre-v0.1.0 release.

## For nicely rendered documentation

Visit **Read the Docs**: https://xee.readthedocs.io/en/latest/

## About this folder

This `docs/` folder contains the source files used to build the documentation site with Sphinx and MyST.

If you're browsing on GitHub:
- Start from [`index.md`](index.md) for the documentation landing page
- Or build the docs locally (see below)

## Build locally (optional)

```bash
cd docs
make html
open _build/html/index.html # or xdg-open on Linux
```

## Project information

For project overview and repository information, see the root [`README.md`](../README.md).
32 changes: 32 additions & 0 deletions docs/_autosummary/xee.EarthEngineBackendArray.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
xee.EarthEngineBackendArray
===========================

.. currentmodule:: xee

.. autoclass:: EarthEngineBackendArray


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~EarthEngineBackendArray.__init__
~EarthEngineBackendArray.async_get_duck_array
~EarthEngineBackendArray.async_getitem
~EarthEngineBackendArray.get_duck_array





.. rubric:: Attributes

.. autosummary::

~EarthEngineBackendArray.ndim
~EarthEngineBackendArray.size


35 changes: 35 additions & 0 deletions docs/_autosummary/xee.EarthEngineBackendEntrypoint.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
xee.EarthEngineBackendEntrypoint
================================

.. currentmodule:: xee

.. autoclass:: EarthEngineBackendEntrypoint


.. automethod:: __init__


.. rubric:: Methods

.. autosummary::

~EarthEngineBackendEntrypoint.__init__
~EarthEngineBackendEntrypoint.guess_can_open
~EarthEngineBackendEntrypoint.open_dataset
~EarthEngineBackendEntrypoint.open_datatree
~EarthEngineBackendEntrypoint.open_groups_as_dict





.. rubric:: Attributes

.. autosummary::

~EarthEngineBackendEntrypoint.description
~EarthEngineBackendEntrypoint.open_dataset_parameters
~EarthEngineBackendEntrypoint.supports_groups
~EarthEngineBackendEntrypoint.url


Loading