Coder Social home page Coder Social logo

ee-download's Introduction

Earth Engine Downloader

This code downloads all images in an image collection from Earth Engine to a specified folder. It can be called from the command line or a Python module.

Installation

This library requires you have set up access to Earth Engine via its Python API and already authenticated your account. See here for more information on how to do that. If you're on Windows, I recommend using Bash on Windows for this project, but won't detail that further here - the installation instructions below assume a bash prompt.

Dependencies

The only dependency for this script, besides the Earth Engine Python API is pycurl for downloading the images. pycurl requires some system setup.

sudo apt-get install libcurl4-openssl-dev
sudo pip install pycurl

You may also need to install PIL if it wasn't installed when you set up the Earth Engine API. Download the latest source kit, then do something like the following

tar -xzvf .\Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
python setup.py install

You have to install the development package for curl before pycurl will compile. The above commands should handle installation.

Command line usage

If you call the script on the command line, it has three simple, positional parameters:

  1. The path or identifier of the ImageCollection to downloading
  2. The output folder on the local machine to save images into
  3. The maximum number of images to download
python ee_download.py "users/yourusername/path/to/image/collection" "/mnt/c/myusername/path/to/outputs" 9999

Usage in Python

After installation, you can import the module and call the main functions - parameters to the bulk downloader are the same as the command line usage above

import ee_download
downloaded_images = ee_download.download_images_in_collection(
		collection_id = "users/yourusername/path/to/image/collection",
		output_folder = "/mnt/c/myusername/path/to/outputs",
		max_items = 9999
)

Alternatively, if you just want to use the single image downloading mechanism, you can run

downloaded_images = ee_download.download_image_by_asset_path(
		asset_path = "users/yourusername/some/single/image",
		output_folder = "/mnt/c/myusername/path/to/outputs",
)

Each function returns the full paths to the downloaded items as a list.

ee-download's People

Contributors

andybell avatar nickrsan avatar

Watchers

 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.