Monitoraggio Geodetico e Telerilevamento Earth Engine exercizes Carla

  • Slides: 18
Download presentation
Monitoraggio Geodetico e Telerilevamento Earth. Engine exercizes Carla Braitenberg Dip. Matematica e Geoscienze Universita’

Monitoraggio Geodetico e Telerilevamento Earth. Engine exercizes Carla Braitenberg Dip. Matematica e Geoscienze Universita’ di Trieste berg@units. it Tel. 339 8290713

Script 05 var landsat 8 = ee. Image. Collection("LANDSAT/LC 08/C 01/T 1_TOA"); var rgb_viz

Script 05 var landsat 8 = ee. Image. Collection("LANDSAT/LC 08/C 01/T 1_TOA"); var rgb_viz = {min: 0, max: 0. 3, bands: ['R', 'G', 'B']}; var rgb_viz 1 = {min: 0, max: 0. 3, bands: ['B', 'G', 'R']}; var images = landsat 8. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']); images = images. filter. Date('2015 -04 -01', '2015 -04 -06'); Map. add. Layer(images, rgb_viz, 'True Color'); Map. add. Layer(images, rgb_viz 1, 'False Color');

Script 6 Median var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L 1 T_TOA"); var

Script 6 Median var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L 1 T_TOA"); var rgb_viz = {min: 0, max: 0. 3, bands: ['R', 'G', 'B']}; var images = landsat 8. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']); images = images. filter. Date('2015 -04 -01', '2015 -10 -06'); Map. add. Layer(images, rgb_viz, 'True Color'); Map. add. Layer(images. median(), rgb_viz, 'True Color median'); Next to median, you have also: mode and mean. Median: Middle value separating the greater and lesser halves of a data set Mode: Most frequent value in a data set Mean: Sum of values of a data set divided by number of values

Script 7 Sentinel var sentinel 2 = ee. Image. Collection("COPERNICUS/S 2"); var landsat 8

Script 7 Sentinel var sentinel 2 = ee. Image. Collection("COPERNICUS/S 2"); var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L 1 T_TOA"); var rgb_viz = {min: 0, max: 0. 3, bands: ['R', 'G', 'B']}; var rgb_viz 2 = {min: 0, max: 2000, bands: ['R', 'G', 'B']}; var images = landsat 8. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']); var images 2 = sentinel 2. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']); images = images. filter. Date('2016 -05 -01', '2016 -05 -06'); images 2 = images 2. filter. Date('2016 -01 -26', '2016 -04 -28'); Map. add. Layer(images, rgb_viz, 'True Color'); Map. add. Layer(images 2, rgb_viz 2, 'True Color sentinel'); Map. add. Layer(images. median(), rgb_viz, 'True Color median');

Script 7 Sentinel- filter on location var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L

Script 7 Sentinel- filter on location var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L 1 T_TOA"); var s 2 = ee. Image. Collection("COPERNICUS/S 2"); var geometry = /* color: 0000 ff */ee. Geometry. Point([13, 45. 5]); // // Landsat 8 // var images = landsat 8. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']); // var rgb_viz = {min: 0, max: 0. 3, bands: ['R', 'G', 'B']}; // Sentinel 2 var images = s 2. select(['B 2', 'B 3', 'B 4', 'B 8'], ['B', 'G', 'R', 'N']); var rgb_viz = {min: 0, max: 2000, bands: ['R', 'G', 'B']}; images = images. filter. Date('2015 -08 -01', '2015 -12 -11'); images = images. filter. Bounds(geometry); var sample = ee. Image(images. first()); Map. add. Layer(sample, rgb_viz, 'sample'); Map. add. Layer(images. median(), rgb_viz, 'True Color median');

Script 8 sentinel Min-max • • var s 2 toa = ee. Image. Collection("COPERNICUS/S

Script 8 sentinel Min-max • • var s 2 toa = ee. Image. Collection("COPERNICUS/S 2"); var rgb_viz = {min: 0, max: 2000, bands: ['R', 'G', 'B']}; var s 2 = s 2 toa. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']). filter. Date('2016 -01 -26', '2016 -04 -28'); print(s 2. size()); Map. add. Layer(s 2, rgb_viz, 'RGB'); Map. add. Layer(s 2. max(), rgb_viz, 'max'); Map. add. Layer(s 2. min(), rgb_viz, 'min');

Script 9 NDVI var s 2 toa = ee. Image. Collection("COPERNICUS/S 2"); var rgb_viz

Script 9 NDVI var s 2 toa = ee. Image. Collection("COPERNICUS/S 2"); var rgb_viz = {min: 0, max: 2000, bands: ['R', 'G', 'B']}; var s 2 = s 2 toa. select(['B 2', 'B 3', 'B 4', 'B 5'], ['B', 'G', 'R', 'N']). filter. Date('2016 -01 -26', '2016 -04 -28'); print(s 2. size()); Map. add. Layer(s 2, rgb_viz, 'RGB', false); var image = s 2. min(); Map. add. Layer(image, rgb_viz, 'image'); var ndvi = image. normalized. Difference(['N', 'R']); var ndwi_viz = {min: -0. 2, max: 0. 2, palette: 'black, green'}; • Map. add. Layer(ndvi, ndwi_viz, 'NDVI'); • • • NDVI=(NIR-Red)/(NIR+Red) Normalized Difference vegetation Index

Script 10 sediment identification Example from Caribbean Sea. The problem is to identify the

Script 10 sediment identification Example from Caribbean Sea. The problem is to identify the sediment input from the River and detect the seasonal changes of the size and form of the sediment cloud. This is done from multispectral Landsat images. var landsat 8 = ee. Image. Collection("LANDSAT/LC 08/C 01/T 1_SR"); var landsat 7 = ee. Image. Collection("LANDSAT/LE 07/C 01/T 1_SR"); //var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L 1 T_TOA"), // landsat 7 = ee. Image. Collection("LANDSAT/LE 7_L 1 T_TOA"); var rgb_viz = {min: 0, max: 1500, bands: ['R', 'G', 'B']}; var rgb_viz 1 = {min: 0, max: 1500, bands: ['B', 'G', 'N']}; var images = landsat 8. select(['B 2', 'B 3', 'B 5', 'B 4'], ['B', 'G', 'N', 'R']); var images 7 = landsat 7. select(['B 1', 'B 2', 'B 4', 'B 3'], ['B', 'G', 'N', 'R']); var geometry = /* color: 0000 ff */ee. Geometry. Point([-75, 11]); images = images. filter. Date('2015 -04 -01', '2015 -04 -06'); images = images. filter. Bounds(geometry); images 7 = images 7. filter. Date('2000 -04 -01', '2000 -12 -30'); images 7 = images 7. filter. Bounds(geometry); Map. add. Layer(images, rgb_viz, 'True Color L 8'); Map. add. Layer(images, rgb_viz 1, 'False Color L 8'); Map. add. Layer(images 7, rgb_viz, 'True Color L 7'); Map. add. Layer(images 7, rgb_viz 1, 'False Color L 7');

False color image compared to true image Landsat 8 (april 2015

False color image compared to true image Landsat 8 (april 2015

Landsat 7 April 2000

Landsat 7 April 2000

sediment identification by histogram analysis The histograms were generated in Earth Engine for the

sediment identification by histogram analysis The histograms were generated in Earth Engine for the Caribbean Sea. The near infrared level is similar, the B, G, R levels are higher where sediments are suspended in water. B G N R Water with sediments Water without sediments

Distinction of water covered areas from land areas • Modifying the bands used for

Distinction of water covered areas from land areas • Modifying the bands used for the false images we can distinguish water covered areas better from land areas. • This can be accomplished by using the bands N and either one of B, G, R.

Calculate the difference between the two dates • Operations: select Landsat 7 and landsat

Calculate the difference between the two dates • Operations: select Landsat 7 and landsat 8 as in previous excersize, apply a reducer to obtain two single images, then calculate the difference between the two images. At last map the difference image, taking care of the much smaller values, so you must adjust the color-scale accordingly.

var landsat 8 = ee. Image. Collection("LANDSAT/LC 08/C 01/T 1_SR"); var landsat 7 =

var landsat 8 = ee. Image. Collection("LANDSAT/LC 08/C 01/T 1_SR"); var landsat 7 = ee. Image. Collection("LANDSAT/LE 07/C 01/T 1_SR"); //var landsat 8 = ee. Image. Collection("LANDSAT/LC 8_L 1 T_TOA"); //landsat 7 = ee. Image. Collection("LANDSAT/LE 7_L 1 T_TOA"); var rgb_viz = {min: 0, max: 1500, bands: ['R', 'G', 'B']}; var rgb_viz 1 = {min: 0, max: 1500, bands: ['B', 'G', 'N']}; var images = landsat 8. select(['B 2', 'B 3', 'B 5', 'B 4'], ['B', 'G', 'N', 'R']); var images 7 = landsat 7. select(['B 1', 'B 2', 'B 4', 'B 3'], ['B', 'G', 'N', 'R']); var geometry = /* color: 0000 ff */ee. Geometry. Point([-75, 11]); images = images. filter. Date('2015 -04 -01', '2015 -04 -06'); images = images. filter. Bounds(geometry); images 7 = images 7. filter. Date('2000 -04 -01', '2000 -12 -30'); images 7 = images 7. filter. Bounds(geometry); var imagesmin = images. min(); var images 7 min = images 7. min(); // calculate normalized difference index between blue and near infrared. Image collection must be reduced before. var ndvi = imagesmin. normalized. Difference(['B', 'N']); var ndwi_viz = {min: -0. 4, max: 0. 4, palette: 'black, green'}; // calculate difference between situation in 2015 and 2000. You must reduce image collection before. var diff = imagesmin. subtract(images 7 min); Map. set. Center(-75, 11, 10); Map. add. Layer(diff, {bands: ['B', 'G', 'N'], min: -500, max: 500}, 'difference'); Map. add. Layer(ndvi, ndwi_viz, 'ndvi'); Map. add. Layer(images, rgb_viz, 'True Color L 8', 'false'); Map. add. Layer(images, rgb_viz 1, 'False Color L 8', 'false');

Difference in false colors. Purple area in oceanic marks the change in suspended sediment

Difference in false colors. Purple area in oceanic marks the change in suspended sediment density

Script 10 a Spectral analysis Pure ocean against Oceans with sediment transport

Script 10 a Spectral analysis Pure ocean against Oceans with sediment transport

var ocean = /* color: #2 f 43 d 6 */ee. Feature( ee. Geometry.

var ocean = /* color: #2 f 43 d 6 */ee. Feature( ee. Geometry. Polygon( [[[-74. 6484375, 11. 315275668856401], [-74. 6539306640625, 11. 250631706195998], [-74. 5989990234375, 11. 216957223287755], [-74. 51934814453125, 11. 214263094930958], [74. 50836181640625, 11. 276221681042255], [-74. 5111083984375, 11. 3139290681802], [-74. 59075927734375, 11. 330087858174997]]]), { "class": "ocean", "system: index": "0" }), seds. Suspended = /* color: #98 ff 00 */ee. Feature( ee. Geometry. Polygon( [[[-74. 91073608398438, 11. 203486330394338], [-74. 91485595703125, 11. 177889906154826], [74. 91348266601562, 11. 152291222111307], [-74. 912109375, 11. 12534280296646], [-74. 89151000976562, 11. 099739495765622], [-74. 85580444335938, 11. 111867658248435], [-74. 83657836914062, 11. 130732686400151], [74. 83932495117188, 11. 161722578835414], [-74. 89151000976562, 11. 198097797540497]]]), { "class": "seds. Susp", "system: index": "0" }), town = /* color: #ff 725 b */ee. Feature( ee. Geometry. Polygon( [[[-74. 866965259989, 10. 628098527268321], [ -74. 7625951428015, 10. 390453900559237], [-74. 5978002209265, 10. 352630022088556], [-74. 405539478739, 10. 417468154740805], [-74. 592307056864, 10. 509299070077184], [-74. 735129322489, 10. 63889619415056]]]), { "class": "town", "system: index": "0" }), landsat 8 = ee. Image. Collection("LANDSAT/LC 08/C 01/T 1_ANNUAL_TOA"); var all. Classes=ee. Feature. Collection([ocean, seds. Suspended, town]) print(all. Classes) var landsat 8_2015=landsat 8. filter. Date('2015 -01 -01', '2015 -12 -31'). select(['B[1 -7]']); var landsat 8_2015=landsat 8_2015. median() print(landsat 8_2015) var rgb_viz = {min: -0. 1, max: 0. 3, bands: ['B 4', 'B 3', 'B 2']}; …continua sulla prossima

Continua dalla precedente. • • • • • • Map. add. Layer(landsat 8_2015, rgb_viz)

Continua dalla precedente. • • • • • • Map. add. Layer(landsat 8_2015, rgb_viz) // define chart options for spectral characterization var chart. Options= { title: 'Spectral Signature of LC', h. Axis: {title: 'Wavelength (micrometers)'}, v. Axis: {title: 'Reflectance'}, line. Width: 1, point. Size: 4, series: { 0: {color: 'd 63000'}, // built-up 1: {color: '98 ff 00'}, // green 2: {color: '8 b 823 b'}, // bare land } }; // define wavelengths corresponding to bands 1 to 7 of Landsat 8 var wavelengths = [0. 44, 0. 48, 0. 56, 0. 65, 0. 86, 1. 61, 2. 2]; // create a graph and print it var spectral. Signature. Chart= ui. Chart. image. regions(landsat 8_2015, all. Classes, ee. Reducer. mean(), 30, 'class', wavelengths). set. Chart. Type('Line. Chart'). set. Options(chart. Options); print(spectral. Signature. Chart);