Subscriptions Delivery to GEE¶
The Subscriptions API now supports delivery to Google Earth Engine (GEE). This integration allows you to create a subscription that will automatically deliver new imagery to your GEE account as it becomes available. This integration works very similarly to the Orders API Integration.
Our python notebook demonstrates how to create a subscription and view the results in GEE.
Pre-requisites¶
- Unlike the Orders API integration, the Subscriptions API integration requires a GEE service account. Check out the GEE Setup Guide for more information on how to set up a service account. After creating the service account, create a key and base64 encode the json key file. The base64 encoded string will go into the
credentials
field in thegoogle_earth_engine
block. - A GEE Image Collection must already exist.
Supported Sources and Tools¶
Item Types * PSScene * SkySatScene * SkySatCollect
All asset types are supported except basic_*
assets.
All tools are supported except for the NITF
profile of file_format
.
Create a Subscription¶
Below is a subscription request body with a standard source block and a GEE delivery block.
{
"name": "GEE Subscription",
"source": {
"type": "catalog",
"parameters": {
"asset_types": [
"ortho_analytic_4b",
"ortho_udm2",
"ortho_visual"
],
"item_types": [
"PSScene"
],
"geometry": {
"coordinates": [
[
[
139.5648193359375,
35.42374884923695
],
[
140.1031494140625,
35.42374884923695
],
[
140.1031494140625,
35.77102915686019
],
[
139.5648193359375,
35.77102915686019
],
[
139.5648193359375,
35.42374884923695
]
]
],
"type": "Polygon"
},
"start_time": "2023-09-08T00:00:00Z",
"end_time": "2023-10-08T00:00:00Z",
}
},
"delivery": {
"type": "google_earth_engine",
"parameters": {
"collection": "my-gee-collection",
"credentials": "<base_64_encoded_SA_key>",
"project": "my-gee-project"
}
},
}
POSTing the above body to https://api.planet.com/subscriptions/v1/
will create a subcriptions GEE delivery.
View Results¶
If your subscription source block matches some items in the Planet catalog, you'll soon receive some deliveries to earth engine.
You can view the status of these deliveries by performing a get request to https://api.planet.com/subscriptions/v1/<subscription_id>/results/
.
[
{
"id": "c26ac3c6-e5bf-4625-b0ea-a0774d48a842",
"status": "success",
"properties": {
"item_id": "20230912_003259_12_24b4",
"item_types": [
"PSScene"
]
},
"created": "2023-09-18T18:57:13.615322Z",
"updated": "2023-09-18T19:05:27.207838Z",
"completed": "2023-09-18T19:05:27.207838Z",
"errors": {},
"outputs": [
"3IY7YWR4YXJT3ABZQKEQLZUP (projects/my-gee-project/assets/my-gee-collection/20230912_003259_12_24b4_3B_AnalyticMS)",
"DPU6EY4URKABCKPOZEDBJEBB (projects/my-gee-project/assets/my-gee-collection/20230912_003259_12_24b4_3B_Visual)"
]
},
{
"id": "8ba9aca0-d1b8-476c-91aa-e781f0cec4da",
"status": "success",
"properties": {
"item_id": "20230910_003337_52_2442",
"item_types": [
"PSScene"
]
},
"created": "2023-09-18T18:57:13.615289Z",
"updated": "2023-09-18T19:05:47.238997Z",
"completed": "2023-09-18T19:05:47.238997Z",
"errors": {},
"outputs": [
"YPOTBYMWG5CHMPZSOPQODBA5 (projects/my-gee-project/assets/my-gee-collection/20230910_003337_52_2442_3B_AnalyticMS)",
"V52VP2VJSRMHSMBX3Q55YBRD (projects/my-gee-project/assets/my-gee-collection/20230910_003337_52_2442_3B_Visual)"
]
}
]
If you results have the success
status, that means that a gee import task has been successfully initiated. That GEE task ID is the first part of each output
string, followed by the GEE asset path. You can use the GEE task ID to check the status of the import task. See the notebook linked at the top of this page for a demonstration.
We are continually working to improve our technical documentation and support. Please help by sharing your experience with us.