PATTERNS
export data
Earth Engine does not permanently store the data objects that you make in your workflows unless you specifically ask it to do so. The patterns below deal with two different scenarios:
- exporting data to a cloud asset
- exporting data to a cloud drive
to cloud asset
Whenever you pan your Map or zoom in and out of your Map, Earth Engine will run through all the steps required to make your data layers at the scale and extent that you are requesting.
Because of this, it is common to get to the point in a workflow where two things happen:
-
Earth Engine starts to balk at the amount of work you are asking it to do and throws time out or tile errors.
-
You get impatient waiting for Earth Engine to process a long workflow just to zoom in and out and pan around your map. (When the slippy map gets sticky, it is like watching a game or movie that keeps buffering.)
At this point, I tend to export my data as an asset so that I can just call the result directly. This is analogous to saving a copy of your data in the cloud. The asset will have a cloud address that you can then use to gather the data back into your workflow with a constructor like ee.Image()
.
Please note that when you export data as cloud assets, you are no longer storing it as a variable. So these patterns do not begin by declaring a variable. They simply execute a function.
export fc
This method will create a task that will export a feature collection as a Google Earth Engine asset. You will need to go to the task tab and run the task. When it is complete, you can access the asset through the asset tab. Open the asset (double-click) and then copy the asset id. You can then use this address in a data gathering pattern for vector data.
geo.fcExport.toCloudAsset(fc, "asset_name");
ARGUMENT | DESCRIPTION |
---|---|
fc | A feature collection to export. |
“asset_name” | A name for the asset. |
export image
This method will create a task that will export an image as a Google Earth Engine asset. You again will need to go to the task tab and run the task. When it is complete, you can access the asset through the asset tab. Open the asset (double-click) and then copy the asset id. You can then use this address in a data gathering pattern for raster data.
geo.iExport.toCloudAsset(
image,
"asset_name",
extent,
"pyramiding"
);
ARGUMENT | DESCRIPTION |
---|---|
image | An image to export. |
“asset_name” | A name for the asset. |
extent | The area of interest or study region to define the bounds of the image. |
“pyramiding” | The method for generating pyramid layers to display in slippy map. Use “mode” for boolean, categorical, and object rasters and “mean” for field rasters. |
This work is licensed under CC BY-NC-SA 4.0