Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a basic Getting Started section to the docs #28

Merged
merged 2 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/source/user_guide/export_locations.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _ExportLocations:

Working with Export Locations - Drive vs. Cloud
====================================================
EEDL works by using Earth Engine's built in export mechanisms, which can
Expand Down
50 changes: 49 additions & 1 deletion docs/source/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
Getting Started with EEDL
============================
============================

At its core, EEDL does just a few things - it take an Earth Engine
Image, exports it in tiles, downloads the pieces and reassembles on your
local machine, giving you the ability to wait for the data to be available
before proceeding.

Most work is done with the EEDLImage class, which is your
entry point to almost all functionality of the EEDL package.

EEDL requires three things in order to run exports

1. An installed copy of the :code:`eedl` package
2. An installed and authenticated copy of the :code:`earthengine` package
3. That you either have Google's :code:`Drive` client installed on the computer that you run your code on, or you have a Google Cloud account with billing set up and a Storage bucket created. See :ref:`here for more considerations <ExportLocations>` on how to run the export.

The simplest script using EEDL would look something like:

.. code-block:: python

import ee
import eedl

# get the first image in the Landsat 9 collection
# you can do anything that gives you an ee.Image object here instead too.
image = ee.ImageCollection("LANDSAT/LC09/C02/T1_L2").first()

# set a download path - the image will be put in this folder
download_folder = r"C:\Users\your_account\data"

# instantiate the EEDLImage object
exporter = eedl.EEDLImage()

# starts the export of your image from Earth Engine to the chosen export location
# does not start the download to your computer or block your code execution after
# starting the export
exporter.export(image, export_type="Drive", drive_root_folder="G:\My Drive")

# tell your code to wait for all images you've exported
# so far to be downloaded and processed before proceeding
eedl.main_task_registry.wait_for_images(download_location=download_folder, callback="mosaic")

# print the path to the downloaded image that you can now use in following code
print(exporter.mosaic_image)

This is an oversimplified example, but it shows the complete workflow. You can export dozens or even hundreds
of images before executing the last line to wait for the images to complete exporting, allowing for large
batch exports, and the class and :code:`.export()` method each support substantial arguments
affecting their behavior.
2 changes: 1 addition & 1 deletion eedl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2023.09.12"
__version__ = "0.2023.9.27"