A collection of tools to work with Google Earth Engine Python API
Project description
:warning: Warning :warning:
This package is under heavy refactoring. If you want to access the previous version, please have a look to the0.x
branch We also start to make pre-release so people can try the latest version. Have a look to the pypi page to stay up-to-date.
:warning: Warning :warning:
Google Earth Engine tools
These are a set of tools for working with Google Earth Engine Python API that may help to solve or automate some processes.
There is JavaScript module that you can import from the code editor that has similar functions (not exactly the same) and it's available here
Note for old users
New version 0.3.0
I have split this package in two. This geetools
will contain functions and
methods related to Google Earth Engine exclusively, so you can use this module
in any python environment you like. For working in Jupyter I have made another
package called ipygee
available here
New version 0.5.0 (breaking changes)
I have split this package in two (again). Now the functions to make a strip
of images using Pillow is available as a different package called geepillow
New version 0.6.0 (breaking changes)
I have split this package in two (again x2). The module geetools.collection
in an independent package called geedataset
Installation
pip install geetools
Upgrade
pip install --upgrade geetools
Basic Usage
Export every image in a ImageCollection
import ee
ee.Initialize()
import geetools
# ## Define an ImageCollection
site = ee.Geometry.Point([-72, -42]).buffer(1000)
collection = ee.ImageCollection("LANDSAT/LC08/C01/T1_SR").filterBounds(site).limit(5)
# Set parameters
bands = ['B2', 'B3', 'B4']
scale = 30
name_pattern = '{sat}_{system_date}_{WRS_PATH:%d}-{WRS_ROW:%d}'
## the keywords between curly brackets can be {system_date} for the date of the
## image (formatted using `date_pattern` arg), {id} for the id of the image
## and/or any image property. You can also pass extra keywords using the `extra`
## argument. Also, numeric values can be formatted using a format string (as
## shown in {WRS_PATH:%d} (%d means it will be converted to integer)
date_pattern = 'ddMMMy' # dd: day, MMM: month (JAN), y: year
folder = 'MYFOLDER'
data_type = 'uint32'
extra = dict(sat='L8SR')
region = site
# ## Export
tasks = geetools.batch.Export.imagecollection.toDrive(
collection=collection,
folder=folder,
region=site,
namePattern=name_pattern,
scale=scale,
dataType=data_type,
datePattern=date_pattern,
extra=extra,
verbose=True,
maxPixels=int(1e13)
)
Some useful functions
batch exporting
- Export every image in an ImageCollection to Google Drive, GEE Asset or Cloud Storage examples
- Clip an image using a FeatureCollection and export the image inside every Feature example
Image processing
- Pansharp example
- Mask pixels around masked pixels (buffer around a mask) example
- Get the percentage of masked pixels inside a geometry example
- Cloud masking functions example
Compositing
- Closest date composite: replace masked pixels with the "last available not masked pixel" example
- Medoid composite example
Image Collections
- Mosaic same day example
Visualization
- Get visualization parameters using a stretching function example
All example Jupyter Notebooks
Jupyter Notebooks avilables here
Contributing
Any contribution is welcome.
Any bug or question please use the github issue tracker
Star History
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file geetools-1.0.0a3.tar.gz
.
File metadata
- Download URL: geetools-1.0.0a3.tar.gz
- Upload date:
- Size: 740.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eba240c4e92a941c9c5f5a768bbca85d42b2b8d06a85f7444cf620e8a3ec671 |
|
MD5 | b70dc15e19ec4d52cd9bfaaa55157e96 |
|
BLAKE2b-256 | 944252b7e978a888a890e6ac22ba9bf6a6245a6fddd9ad048580048c4081a6a5 |
File details
Details for the file geetools-1.0.0a3-py3-none-any.whl
.
File metadata
- Download URL: geetools-1.0.0a3-py3-none-any.whl
- Upload date:
- Size: 90.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c5bd322167c3517ac4a0c33f0d905fa35a72965881af77ea33f13ee2f12cac |
|
MD5 | 76fb3d2f55b37106eda512fc831dbece |
|
BLAKE2b-256 | 0903025e11b8a9a31f69b53544074021d4b70787fcffb5f82d2e6d3640eac108 |