Link Search Menu Expand Document

Tutorial 6

Import and Export

Export Images and Vector



// Create an image variable (named Landsat) and select three bands.
var landsat = ee.Image('LANDSAT/LC08/C01/T1_TOA/LC08_123032_20140515')
	.select(['B4', 'B3', 'B2']); //only select band 4, 3 and 2 for import

// Create a geometry representing an export region.
var geometry = ee.Geometry.Rectangle([116.2621, 39.8412, 116.4849, 40.01236]);

// Export the image, specifying scale in meters and region.
Export.image.toDrive({
	image: landsat, //set the name of export image to be landsat
	description: 'imageToDriveExample', //set the export image task to be imageToDriveExample
	scale: 30, //define scale to 30 meters
	region: geometry //set the region of export to predefined geometry
});



// Make a collection of points.
var features = ee.FeatureCollection([
	ee.Feature(ee.Geometry.Point(30.41, 59.933), {name: 'Voronoi'}),
	ee.Feature(ee.Geometry.Point(-73.96, 40.781), {name: 'Thiessen'}),
	ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {name: 'Dirichlet'})
]);

// Export the FeatureCollection to a KML file.
Export.table.toDrive({
	collection: features,
	description:'vectorsToDriveExample',
	fileFormat: 'KML'
});

Import Images and Shapefiles

In addition to using the imagery in GEE, you can also upload image files (up to 10 GB each) to your Earth Engine user folder. To upload a GeoTiff (other raster formats are not currently supported), click the “NEW” button under the “Assets” tab in the left panel and then select “Image upload”. Earth Engine presents an upload dialog. Click the SELECT button and navigate to a GeoTiff on your local file system.

Give the image an appropriate asset ID (which doesn’t already exist) in your user folder. If you want to upload the image into an existing folder or collection, prefix the asset ID with the folder or collection ID, for example /users/name/folder-or-collection-id/new-asset.

To upload a Shapefile from the Code Editor, click the “New” button, then select Shape files under the Table Upload section. An upload dialog similar to Figure 1 will be presented. Click the SELECT button and navigate to a Shapefile or Zip archive containing a Shapefile on your local file system. When selecting a .shp file, be sure to select the related .dbf, .shx and .prj files. Earth Engine will default to WGS84 (longitude, latitude) coordinates if a .prj file is not provided. If you are uploading a Zip archive, make sure it contains only one Shapefile (set of .shp, .dbf, .shx, .prj, etc.) and no duplicate filenames. Make sure filenames do not include additional periods or dots. (Filenames will include a single period before the extension.)