Presentation is loading. Please wait.

Presentation is loading. Please wait.

Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste

Similar presentations


Presentation on theme: "Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste "— Presentation transcript:

1 Monitoraggio Geodetico e Telerilevamento Supplementary EarthEngine exercizes
Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste Tel Tel. Assistente Dr. Nagy:

2 Please follow the next scripts
Javascript Reference:

3 Select images defined by a boundary. Adapt boundary to your needs
Select images defined by a boundary. Adapt boundary to your needs. Change coordinates of map-center accordingly // Filter an image collection by date and region to make a // median pixel composite. // // See also: ClippedComposite, which crops the output image // instead of filtering the input collection. // Filter to only include images within the colorado and utah boundaries. var polygon = ee.Geometry.Polygon([[ [ , 37.0], [ , 37.0], [ , 41.0], // colorado [ , 41.0], [ , 41.0], [ , 42.0], // utah [ , 42.0], [ , 37.0], [ , 37.0]]]); // Create a Landsat 7 composite for Spring of 2000, and filter by // the bounds of the FeatureCollection. var collection = ee.ImageCollection('LE7_L1T') .filterDate(' ', ' ') .filterBounds(polygon); // Select the median pixel. var median = collection.median(); // Select the red, green and blue bands. var result = median.select('B3', 'B2', 'B1'); Map.addLayer(result, {gain: '1.4, 1.4, 1.1'}); Map.setCenter(-110, 40, 5);

4 Trend of lithtime- find areas that have expanded the most
Check definition of the image collection: ImageCollection ID NOAA/DMSP-OLS/NIGHTTIME_LIGHTS It gives yearly stable lighttime near to globally between 1992 and 2014 from the analysis of satellite thermal infrared imaging. It can be used to calculate the linear trend of the intensity of night time. For each pixel a linear function is fitted, defined by the slope and intercept. In earth engine the two quantities are termed “scale” and “offset” and are feeded into two image bands. These can be mapped each singularly by a grey-tone image, or together in the color image of the script.

5 Compute trend of lightime globally.
// Compute the trend of nighttime lights from DMSP. // Add a band containing image date as years since 1991. function createTimeBand(img) { var year = ee.Date(img.get('system:time_start')).get('year').subtract(1991); return ee.Image(year).byte().addBands(img); } // Fit a linear trend to the nighttime lights collection. var collection = ee.ImageCollection('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS') .select('stable_lights') .map(createTimeBand); var fit = collection.reduce(ee.Reducer.linearFit()); // Display a single image Map.setCenter(30, 45, 4); Map.addLayer(ee.Image(collection.select('stable_lights').first()), {min: 0, max: 63}, 'stable lights first asset'); // Display trend in red/blue, brightness in green. Map.addLayer(fit, {min: 0, max: [0.18, 20, -0.18], bands: ['scale', 'offset', 'scale']}, 'stable lights trend');

6 Create a feature collection and average values.
Create a Polygon and a rectangle. In the intersection of the two change the color on the map.

7 Rectangle and Triangle
// Example of FeatureCollection.reduceToImage() // Define a feature collection with a value we want to average. var fc = new ee.FeatureCollection([ ee.Feature( ee.Geometry.Rectangle( , , , ), {'value': 0}), ee.Geometry.Polygon([ [ , ], [ , ], [ , ]]), {'value': 1}) ]); // Reduce the collection to an image, where each pixel // is the mean of the 'value' property in all features // intersecting that pixel. var image_reduced = fc.reduceToImage(['value'], 'mean'); Map.setCenter( , , 14); Map.addLayer(image_reduced, { min: 0, max: 1, palette: ['008800', '00FF00']});

8 Cycle through Landsat Images over the same spot
// Compare MSS images from L1 through L5 var sfPoint = ee.Geometry.Point( , ); Map.setCenter( , , 10); //var sfPoint = ee.Geometry.Point(13.,45.3); this for images centered close to Trieste //Map.setCenter(13,45.3, 10); for (var i = 1; i <= 5; ++i) { var collection = ee.ImageCollection('LM' + i + '_L1T'); var image = ee.Image(collection.filterBounds(sfPoint).first()); var toa = ee.Algorithms.Landsat.TOA(image); var date = ee.Date(image.get('system:time_start')).format('MMM yyyy'); var bands = (i <= 3) ? ['B6', 'B5', 'B4'] : ['B2', 'B3', 'B1']; // This is one of the rare places where we need to use getInfo() in the // middle of a script, since layer names must be client-side strings. var label = 'Landsat' + i + ' (' + date.getInfo() + ')'; Map.addLayer(toa, {bands: bands, min: 0, max: 0.4}, label); }

9 Some explanations of previous script
for (var i = 1; i <= 5; ++i) { // this to repeat the following lines 5 times. var collection = ee.ImageCollection('LM' + i + '_L1T'); //this to change name of collection var image = ee.Image(collection.filterBounds(sfPoint).first()); var toa = ee.Algorithms.Landsat.TOA(image); // apply a correction to these crude images. TOA is top of Atmosphere var date = ee.Date(image.get('system:time_start')).format('MMM yyyy'); //find date of the selected image var bands = (i <= 3) ? ['B6', 'B5', 'B4'] : ['B2', 'B3', 'B1']; //for landsat 1 to 3, use bands B6,B5;B4, else use B3,B2,B1 (see next page for docu on landsat1) // This is one of the rare places where we need to use getInfo() in the // middle of a script, since layer names must be client-side strings. var label = 'Landsat' + i + ' (' + date.getInfo() + ')'; //prepare the label including the date Map.addLayer(toa, {bands: bands, min: 0, max: 0.4}, label); }

10 Landsat1 documentation
Multispectral Scanner (MSS) 80-meter ground resolution in four spectral bands: Band 4 Visible green (0.5 to 0.6 µm) Band 5 Visible red (0.6 to 0.7 µm) Band 6 Near-Infrared (0.7 to 0.8 µm) Band 7 Near-Infrared (0.8 to 1.1 µm) Six detectors for each spectral band provided six scan lines on each active scan Ground Sampling Interval (pixel size): 57 x 79 m

11 The bands of the MSS sensor on Landsat 1-5


Download ppt "Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste "

Similar presentations


Ads by Google