Giter Site home page Giter Site logo

gee_tools's Introduction

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

gee_tools's People

Contributors

fitoprincipe avatar marccoru avatar samsammurphy avatar dependabot[bot] avatar lumbric avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.