get min max of an image

Get stats of an area

Step 1: Display the srtm using the code below.

// import srtm dem
var srtm = ee.Image("USGS/SRTMGL1_003");

// mask areas less than 0
srtm = srtm.mask(srtm.gt(0));

// add layer to map
Map.addLayer(srtm,{min:??,max:??,palette:"??????"});

Step 2: Find the min max using the inspector.
srilanka16.jpg

Step 3: draw a geometry

srilanka17.jpg

Step 4: calculate the min max using the code below

var minMax = srtm.reduceRegion(ee.Reducer.minMax(),geometry);
print(minMax);

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s