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

Google Earth Engine integration notebook #220

Merged
merged 15 commits into from
Jan 20, 2023
Merged

Conversation

kevinlacaille
Copy link
Contributor

This notebook outlines how to integrate Planet with Google Earth Engine (GEE) using Planet's service account and the Orders API. There will be a follow up notebook, which will outline how to integrate with GEE using a custom service account.

Closes #210

@kevinlacaille kevinlacaille self-assigned this Nov 16, 2022
@kevinlacaille kevinlacaille linked an issue Nov 16, 2022 that may be closed by this pull request
@kevinlacaille kevinlacaille marked this pull request as ready for review November 18, 2022 19:17
Copy link
Contributor

@lobugliop lobugliop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I was able to run this locally. Just some small comments

"source": [
"# Google Earth Engine configuration\n",
"cloud_config = planet.order_request.google_earth_engine(\n",
" project='planet-devrel-dev', collection='gee-integration-testing')\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#nit might be nice to have the GEE delivery options as consts at the top of the notebook

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this were a regular script I would 100% do this, but I fear that would be a little inconsistent with how we typically lay out our notebooks. Thoughts on this @mkshah605?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be open to it! It might make sense so users can easily change their credentials. It's similar to how I laid out this Subscriptions notebook, where people can define their bucket and gcs key in cell #2. Definitely open to your thoughts!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've thought about it and we only use the project and collection names a single time, just in this cell, and it feels a bit unnecessary to define these as constants. @mkshah605, it makes sense in your subscriptions notebook, as you use bucket and gcs_key more than once in your notebook, but in this case I seem to justify creating two more variables. Are you opposed to leaving them as is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that makes sense. I am good with leaving them in here

@samroy-pl
Copy link

This notebook is well set up to interact directly with the Python SDK as expected, this is not backward compatible, and maybe we need to include the SDK version information needed somewhere on the notebook.

Change cell 1 to this

# Order and Delivery to Google Earth Engine

In this notebook we're going to cover how to order data using the [Orders API](https://developers.planet.com/apis/orders/) and deliver it to [Google Earth Engine (GEE)](https://earthengine.google.com/) using [Planet’s GEE Delivery integration](https://developers.planet.com/docs/integrations/gee/).

This example demonstrates how to:
1. Define the data to be ordered
2. Build a cloud delivery configuration object (`delivery_config`), which tells the Orders API where to deliver the data
3. Build an order request to be sent off to the Orders API, `iowa_order`
4. Create the order and have it deliver to your GEE project

**Prerequisites:** 
- Planet python SDK 2.0 installed and initialized in your environment(**This notebook is not compatible with earlier version of the Planet SDK**)
- An AOI - `iowa_aoi`
- Item ID(s) - `iowa_images`
- A GEE project with EE API enabled - `planet-devrel-dev`
- A pre-existing GEE [ImageCollection](https://developers.google.com/earth-engine/guides/ic_creating) - `gee-integration-testing`
- An account with a download quota. Not sure if you have download quota? Please [get in touch](https://www.planet.com/contact-sales/).

Images might be delivered while the script polls for status to change to success, but images might be delivered to Earth Engine collection during the wait time, so I would include that information

@kevinlacaille
Copy link
Contributor Author

Note that only clipping and harmonization are the only two tools that are compatible with GEE in cell 15.

@kevinlacaille kevinlacaille merged commit b723c97 into master Jan 20, 2023
@kevinlacaille kevinlacaille deleted the gee-integration-210 branch January 20, 2023 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GEE Integration
4 participants