Import, export & render
Chris Herwig, Google
2018 Earth Engine User Summit
Agenda
CONFIDENTIAL
Organize the world's Earth observation information and make it universally accessible and useful
| | | | | |
Chart | Image | Earth Engine Asset | Table | Video | Map |
Google Confidential and Proprietary
Key
Concepts
Key Concepts
Pyramiding Policy
How each pixel at a given level of the pyramid is computed from the aggregation of a 4x4 block of pixels at the next lower level.
Continuous valued images: mean
Discrete valued images: sample (usually the top left pixel) of pixels at the next lower level.
.
Key Concepts
Access Control Lists (ACL) | | scale | | dimensions |
By default, assets users upload to their Earth Engine account are private -- accessible only to that user. Users can change access control settings on individual assets or collections. Update ACLs using Asset Manager in Code Editor or via command line earthengine acl command | | (in meters) Ex. 30 | | dimensions (in pixels): width and height for output image, Ex: '1024x768' |
Key Concepts
crs | | crsTransform | | region |
Coordinate Reference System. Ex: 'EPSG:4326' | | A list of affine transformation parameters in row-major order [xScale, xShearing, xTranslation, yShearing, yScale, yTranslation] If not explicitly specified, the CRS of the output will be taken from the first band of the image to be exported. crsTransform, scale, and dimensions are mutually exclusive. | | (ee.Geometry) region of image to export |
maxPixels
| | | | |
The maxPixels parameter is intended to prevent very large exports from inadvertently being created. | | Increase maxPixels if the default value is too low for your intended output image. | | If the output image file is large, it will be exported as multiple tiles, with each named baseFilename-yMin-xMin. maxPixels default is 1e8. |
Command-line utility
install | | authenticate | | use |
| After installing, you'll need to authenticate via the earthengine authenticate command | | Once authenticated, CLI supports: Create/manage assets and collections, ACL setting moving/deleting/copying assets, uploading raster data And more... |
Data in Earth Engine
Vector
Vector
Raster
Image
Image Collection
Public
data catalog
>200 public datasets
Earth Engine
Public Data Catalog of 200+ datasets (>6 PB)
800+ analysis functions
Landsat and Sentinel
40+ year archive of the entire planet
MODIS
2 global images every day.
Terrain and Landcover
Weather and Climate
Asset management
Asset Manager
Manage asset properties
Command-line asset property management
# update/set date of an asset�$ earthengine asset set --time_start 2016-05-01T12:34:56 \� users/username/asset_id;
# add properties to asset�$ earthengine asset set -p '(number)clouds=42' \� users/username/asset_id
# add string property to asset�$ earthengine asset set -p '(string)station=Alaska' \� users/username/asset_id
Click the Share button to configure access to your private assets. You can also share by hovering over the asset and clicking the share icon.
The sharing dialog (Figure 4) lets you configure read or write access for individuals or groups (specified by a domain).
To make an asset public, check the 'Anyone can read' box. Any user with write access to a folder will be able to delete assets from it.
Proprietary + Confidential
Share
Proprietary + Confidential
Proprietary + Confidential
Earth Engine accounts come with 250GB of storage quota, which is independent of any Drive quota you might have.
Quota usage is measured by the total number and the compressed size of stored assets.
You can view your usage by clicking the data usage icon next to users/username in the Asset Manager.
Proprietary + Confidential
Quota
Proprietary + Confidential
Proprietary + Confidential
Move images and collections into folders with drag and drop.
To remove images from the collection, click on the collection to open dialog.
Proprietary + Confidential
Create image collections
Proprietary + Confidential
Proprietary + Confidential
Command-line create image collections
# create new image collection�$ earthengine create collection \� users/herwig/eeus/collection1�# add images to the collection�# can use mv or cp command�$ earthengine mv \� users/herwig/eeus/2_8_10x_2 \� users/herwig/eeus/collection1/2_8_10x_2
Questions
Upload vector
Upload shapefile with sidecar files or zip file
If prj file is omitted, WGS84 is assumed.
Code Editor: Upload table
Proprietary + Confidential
Proprietary + Confidential
Upload large vector datasets to Google Fusion Tables
Import in Earth Engine script
CSV or KML
Code Editor: Import table from Fusion Tables
var fusionTable = ee.FeatureCollection(�'ft:1kSWksPYW7NM6QsC_wnCuuXO7giU-5ycxJb2EUt8')
Proprietary + Confidential
Proprietary + Confidential
var region = ee.Geometry.Point(
[151.213, -33.87]);�
var vis = {� min:500,� max:3000,� gamma:1.4,� bands: ['B4', 'B3', 'B2']�}
�var collection = ee.ImageCollection('COPERNICUS/S2')� .filterBounds(region)� .sort('system:time_start')� // Need to make the data 8-bit.� .map(function(image) {� return image.visualize(vis);� });
Export.video.toDrive({� collection: collection,� description: 'sydney-5fps',� dimensions: 1080,� framesPerSecond: 5,� region: region�});
Hand-drawn geometries in code editor
Copy/paste GeoJSON
var feats = ee.FeatureCollection(json.features);
Questions
Upload Raster
Upload raster
Command-line: Upload raster
assetid="users/herwig/eeus/mytestupload";�earthengine upload image \� --asset_id="${assetid}" \� --pyramiding_policy=sample \� --nodata_value=0 \� gs://bucket/image.tif \� gs://bucket/image2.tif�
Command-line: Tiled Raster Upload
earthengine upload image \� --asset_id=users/herwig/eeus/pr_hro_tiled \� --property="(string)provider=usgs" \� --time_start=2013-03-13T00:00:00 \� gs://herwig-export-tests/pr-hro/7_12.tif \� gs://herwig-export-tests/pr-hro/7_13.tif \� gs://herwig-export-tests/pr-hro/8_12.tif \� gs://herwig-export-tests/pr-hro/8_13.tif�
Try it out
var importedAsset =
ee.Image('users/herwig/eeus/pr_hro_tiled');�Map.setCenter(-66.090923, 18.375517, 16);�Map.addLayer(importedAsset);
Questions
Export table
Export table
You can export a FeatureCollection as CSV, SHP (shapefile), GeoJSON, KML, or KMZ using Export.table.
Format-specific constraints:
Export image
Export image
Cloud-optimized GeoTIFF
You can specify image output format (if the destination is not toAsset()) with the fileFormat parameter (currently only the default, 'GeoTIFF', is enabled).
Other configuration options are set with the formatOptions parameter, which should be a dictionary keyed by other format options (currently only cloudOptimized, to export a cloud-optimized GeoTIFF, is enabled and is false by default).
// Export a cloud-optimized GeoTIFF.�Export.image.toDrive({� image: landsat,� description: 'imageToCOGeoTiffExample',� scale: 30,� region: geometry,� fileFormat: 'GeoTIFF',� formatOptions: {� cloudOptimized: true� }�});
Exporting images as they appear in the Code Editor
RGB export in QGIS
Setting no-data = 0 in QGIS
Add image mask as fourth band for use in QGIS/other
var mask = denmark.mask()� .reduce(ee.Reducer.min())� .multiply(255).toByte();�denmark = denmark.addBands(mask);
RGBA export in QGIS
Export Image to Cloud Storage
To use Google Cloud Storage, you'll need to set up a project, enable billing for the project, and create a storage bucket.
See the Cloud Storage Quickstart page for instructions.
Data exported to a Cloud Storage bucket will have the bucket's default object Access Control List (ACL).
You must have write permission for the specified bucket.
// Export a cloud-optimized GeoTIFF.�Export.image.toDrive({� image: landsat,� description: 'imageToCOGeoTiffExample',� scale: 30,� region: geometry,� fileFormat: 'GeoTIFF',� formatOptions: {� cloudOptimized: true� }�});
Export Image to Earth Engine Asset
Test it out
var newAsset = ee.Image('users/herwig/eeus/denmark_landsat8')�Map.addLayer(newAsset);
Questions
Export video
Export video
Export Video to Drive
var region = ee.Geometry.Point(
[151.213, -33.87]);�
var vis = {� min:500,� max:3000,� gamma:1.4,� bands: ['B4', 'B3', 'B2']�}
�var collection = ee.ImageCollection('COPERNICUS/S2')� .filterBounds(region)� .sort('system:time_start')� // Need to make the data 8-bit.� .map(function(image) {� return image.visualize(vis);� });
Export.video.toDrive({� collection: collection,� description: 'sydney-5fps',� dimensions: 1080,� framesPerSecond: 5,� region: region�});
Source: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non erat sem
Proprietary + Confidential
ffmpeg \
-i input.mp4 \
output.gif
ffmpeg \
-i timelapse.mp4 \
-f image2 \
-start_number 1984 \
image-%03d.jpg
Surface water occurrence - Pekel et al., JRC
Source: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis non erat sem
Proprietary + Confidential
Google Confidential and Proprietary
Google Confidential and Proprietary
Google Confidential and Proprietary
Google Confidential and Proprietary
Export Video to Cloud Storage
Export.video.toCloudStorage({� collection: collection,� description:'videoToGCS',� bucket: bucketName,� dimensions: 1080,� framesPerSecond: 1,� fileNamePrefix: 'myvideos/',� region: region�});
Export Map Tiles
Export Map Tiles
*Unless you choose not to write public tiles (writePublicTiles=false), in which case the tiles inherit the bucket’s default object ACL
Export Map Tiles
Export Map Tiles
Export Map Tiles
15/10367/14681
15/10367/14682
15/10368/14681
15/10368/14682
Export Map Tiles
var image = ee.Image("users/herwig/eeus/rocket_tiled");�Map.addLayer(image);��var southBounds = ee.Geometry.Polygon(� [-180, 85, 0, 85,� 179.998, 85, 179.998, -85,� 0, -85, -180, -85� ], null, false);��Export.map.toCloudStorage({� image: image,� bucket: 'herwig-export-tests',� description: 'export-rocket',� path: 'maps/20180118/rocket',� minZoom: 0,� maxZoom: 6,� region: southBounds,�});
Export Map Tiles
Export Map Tiles
It's a map!
Export Map Tiles
Share Earth Link
Cloud + Maps Platform Credits Programs
Cloud: Geo for Good Cloud Credits Program: g.co/earth/cloud-credits
Maps: Eligible nonprofits, startups, crisis response, and news media organizations may apply for Google Maps Platform credits through the following programs: