Giter Club home page Giter Club logo

eeutil's Introduction

eeUtil

Wrapper for easier data management with Earth Engine python sdk

Requires account with access to Google Cloud Storage and Earth Engine.

import eeUtil as eu

# initialize from environment variables
eu.init(bucket='mybucket')

# create image collection
eu.createFolder('mycollection', imageCollection=True)

# upload image to collection
eu.upload('image.tif', 'mycollection/myasset')
eu.setAcl('mycollection', 'public')
eu.ls('mycollection')

Install

pip install -e git+https://github.com/fgassert/eeUtil.git#egg=eeUtil

Develop

git clone https://github.com/fgassert/eeUtil.git
cd eeUtil
pip install -e .

Nice things?

  • More consistent python bindings
  • GEE paths not starting with / or users/ are relative to your user root folder (users/<username>)
  • Upload atomatically stages files via Google Cloud Storage

Usage

eeUtil defaults to reading from credentials saved by gcloud auth for Google Cloud Storage and earthengine authenticate for Earth Engine. In your script, initialize these credentials with eeUtil.init(). These credentials are read from environment variables as follows.

# environment variables
export GEE_SERVICE_ACCOUNT=<[email protected]>
export GOOGLE_APPLICATION_CREDENTIALS=<path/to/credentials.json>
export CLOUDSDK_CORE_PROJECT=<my-project>
export GEE_STAGING_BUCKET=<my-bucket>

Alternatively credentials can be provided directly to eeUtil.init() via a json credential file or via a json string in the GEE_JSON environment variable.

eeUtil.init([service_account=], [credential_path=], [project=], [bucket=])
  • service_account Service account name. If not specficed, reads defaulds from earthengine authenticate. For more information on GEE service accounts, see: https://developers.google.com/earth-engine/service_account [default: GEE_SERVICE_ACCOUNT]
  • credential_path Path to json file containing private key. Required for service accounts. [default: GOOGLE_APPLICATION_CREDENTIALS]
  • project GCS project containing bucket. Required if account has access to multiple projects. [default: CLOUDSDK_CORE_PROJECT]
  • bucket Storage bucket for staging assets for ingestion. Will create new bucket if none provided. [default: GEE_STAGING_BUCKET]

eeutil's People

Contributors

fgassert avatar

Watchers

James Cloos avatar  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.