get_started - AtmaMani/gee GitHub Wiki
GEE API
Fundamental data structures are the Image
and Feature
classes. Feature
contains a Geometry
and a dict of properties, Image
consists of bands and dict of properties.
A stack of Image
objs form the ImageCollection
, similarly, a stack of Feature
s is handled by FeatureCollection
. All these are server-side objects.
Fundamentals
Create an Image obj
The ee
namespace comes loaded in the code editor. Hence, just run
var image1 = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00');
Load an image to map
Map.centerObject(image1, 9);
Map.addLayer(image1);
The centerObject()
static method (since its called off the Map
class and not an instance) accepts a scale range. Higher numbers = large scale, small number = small scale. You can load with optional parameters like this:
var vizParams = {bands: ['B5', 'B4', 'B3'],
min: 5000, max:15000, gamma:1.3};
Map.addLayer(image1, vizParams, 'Landsat FCC')
Load features to a map
Construct a FeatureCollection
using a fusion tables dataset as below. You reference the table using its encrypted key
var counties = ee.FeatureCollection('ft:1S4EB6319wWW2sWQDPhDvmSBIVrD3iEmCLYB7nMM');
Map.addLayer(counties, {}, 'counties');
git clone https://earthengine.googlesource.com/115197442567592026705 private_ee_scripts