Skip to main content

A python package to extract gee data for machine learning.

Project description

image image Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

GEEML: Google Earth Engine Machine learning

A python package to extract gee data for machine learning.
Explore the documentation »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Basic Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This python package makes it easier to extract satellite data from Google Earth Engine using parallel processing and the Google Earth Engine high volume end point.

In its current state it supports the extraction of data for traditional machine learning (tabular data) in the form of csv's and the extraction of GeoTiff image patches for Deep Neural Networks.

Motivation

The Machine learning capabilities in the GEE JS code editor remain limited. For example, there is no support for XGBoost, LightGBM, NGBoost, etc. Moreover, the python ecosystem has much more support for training, valdation and hyperparameter tuning. However, for this functionality to be leveraged, data needs to be downloaded locally or stored in Google Drive or Google Cloud Storage to benefit from the Machine learning python ecosystem. Therfore, this package aims to make it easier and faster to download GEE-processed data in a machine learning-ready format.

Features

  • Parallel export of images or sparse images (for example, GEDI).
  • Export raster values at points or polygons (ee.FeatureCollection).
  • Summarise raster data within polygons (ee.FeatureCollections).
  • Extract both tabular and Deep Neural Network (DNN) type datasets.

Getting Started

Installation

To install this package:

  1. pip
    pip install geeml
    
  2. Build from source (latest version)
    pip install git+https://github.com/Geethen/geeml.git
    

(back to top)

Basic usage

Download the NASADEM elevation data for Kenya.

#import packages
import ee
from geeml.utils import getCountry
from geeml.extract import extractor

# Authenticate GEE
ee.Authenticate()
# Initialize GEE with high-volume end-point
ee.Initialize(opt_url='https://earthengine-highvolume.googleapis.com')

# Import datasets from GEE
nasadem = ee.Image("NASA/NASADEM_HGT/001")
# A point in Kenya
poi = ee.Geometry.Point([37.857884,-0.002197])
kenya = getCountry(poi)

# Download directory
dd = '/content/drive/MyDrive/geeml_example'

# Prepare for data extraction
trialExtractor = extractor(covariates=nasadem, aoi = kenya, scale= 5000, dd= dd)

# Extract data
trialExtractor.extractAoi()

For more examples, please refer to the Documentation

(back to top)

Roadmap

  • Support the export of additional formats (TFrecords)
  • Download data from GEE based on local shapefiles
  • Add more examples for using the package

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Geethen Singh - @Geethen - geethen.singh@gmail.com

Project Link: https://github.com/Geethen/geeml

(back to top)

Acknowledgments

This package was created with Cookiecutter and the giswqs/pypackage project template.

This package uses the geedim package for extracting image data at an AOI

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geeml-0.0.7.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

geeml-0.0.7-py2.py3-none-any.whl (14.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file geeml-0.0.7.tar.gz.

File metadata

  • Download URL: geeml-0.0.7.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for geeml-0.0.7.tar.gz
Algorithm Hash digest
SHA256 d31ef210a21d1593049e43b0e90b50607568570e71f4b5197cb629f66c1b1301
MD5 6c7ee71628cdb2a91c8f343f88ba4858
BLAKE2b-256 b3c7dd4a7afd2ae02b831a3ebb489279290c9b37f97cf1c765b1a6ace379cf6f

See more details on using hashes here.

File details

Details for the file geeml-0.0.7-py2.py3-none-any.whl.

File metadata

  • Download URL: geeml-0.0.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for geeml-0.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f138e18ad24f65b97f7da272ba8b7f509dda6d0aee372bc4ad9b3fa356346431
MD5 86f63a147245f018bff3cf92b5d2c574
BLAKE2b-256 963f61be9479c1d6d1bef26ebc790a058a473e9f26263dedb768dd0f71342141

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page