• Stars
    star
    509
  • Rank 86,772 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 7 years ago
  • Updated 21 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A collection of tools to work with Google Earth Engine Python API

Google Earth Engine tools

These are a set of tools for working with Google Earth Engine Python API that may help to solve or automatize 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 splitted 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 splitted 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 splitted 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

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

More Repositories

1

geemap

A Python package for interactive geospatial analysis and visualization with Google Earth Engine.
Python
3,446
star
2

qgis-earthengine-plugin

Integrates Google Earth Engine and QGIS using Python API
Python
448
star
3

ee-palettes

A set of common color palettes for Google Earth Engine
HTML
311
star
4

awesome-google-earth-engine

Curated list of Google Earth Engine resources
92
star
5

example-scripts

Example scripts originally derived from Prof. Dana Tomlin's handouts for his course on Geospatial Software Design. Shared with his permission.
86
star
6

ee-jupyter-contrib

Using Jupyter as an Earth Engine IDE - Community Contributions
Jupyter Notebook
73
star
7

ee-tensorflow-notebooks

Repository to place example notebooks for Deep Learning applications with TensorFlow and Earth Engine.
Jupyter Notebook
71
star
8

ee-runner

Command-line runner for Google Earth Engine Playground scripts
JavaScript
67
star
9

geeViz

Repository of GEE libraries produced by RedCastle Inc at the US Forest Service Geospatial Technology Applications Center
Python
34
star
10

ee-LandsatLinkr

Python
28
star
11

ee-packages-py

Python version of some usefuly Google Earth Engine utilities (migrated from /users/gena/packages JavaScript)
Python
25
star
12

sar-asf-to-gee

Facilitates transferring on-demand SAR products processed by ASF's HyP3 to Google Earth Engine.
Jupyter Notebook
23
star
13

ee-js-to-python-syntax

Simplistic conversion of earthengine JavaScript to Python syntax.
Jupyter Notebook
18
star
14

msslib

An Earth Engine JavaScript library for working with Landsat MSS image data.
JavaScript
17
star
15

eeconvert

earth engine conversion for jupyter notebook use
Python
16
star
16

geo-aquawatch-water-quality

Code produced for the GEE-GEO Aquawatch project.
Jupyter Notebook
11
star
17

ee-community

9
star
18

GEE-Dev-Docs

A collaborative platform for accessing and submitting Google Earth Engine tutorials.
CSS
8
star
19

eetasks

Earth Engine tasks monitoring in vscode
TypeScript
6
star
20

ee-packages-js

JavaScript version of useful Google Earth Engine scripts and examples
JavaScript
5
star
21

pygaul

Easy access to administrative boundary defined by FAO GAUL from Python scripts
Python
3
star
22

gee-community.github.io

2
star
23

geeMigrator

Method to facilitate migration of GEE assets from one account to another
Python
2
star
24

pytest-gee

The pytest plugin for your gee package 🌍
Python
2
star
25

eefa-notebook

Python scripts and Jupyter notebooks for the EEFA book
1
star