Sample to show identify pixel function in Sentinel 2 and DEM collections¶

This notebook first creates the map and an ipyWidget label under the map

In [ ]:
from ipywidgets import widgets
map = Map()
label = widgets.Label(layout=widgets.Layout(width='100%', max_width='1000px'))
widgets.VBox([map, label])

Then a collection of Sentinel 2 images over Amatrice for the dates just after the earthquake is built

In [ ]:
coll = inter.ImageCollection("S2")
coll = coll.filterOnGeoName("Amatrice",0).filterOnDate(2016,8,25, 2016,12,31)
coll = coll.filterOn("cloudcover", "<=", 5).filterOn("jrc_filepath", "<>", "")
coll.limit(10)
coll.count()

Then a processing element creating a false color RGB composition is derived from the collection and displayed on the map, activating the identify marker to query the pixel values and output them to the label

In [ ]:
p = coll.process().bands("B08","B03","B02")
#p = coll.process().count("B11")
#p = coll.process().band("B11")
#p = coll.process().NDVI()
map.clear()
tlayer = map.addLayer(p.toLayer())
map.zoomToImageExtent(p)
mark = inter.identify(map,p,label)

The same is done for the DEM display and pixel identify

In [ ]:
coll = inter.ImageCollection("DEM")
p = coll.process()
p.scale(0,2000)
p.opacity(255)
map.clear()
tlayer = map.addLayer(p.toLayer())
mark = inter.identify(map,p,label)
In [ ]:
mark.visible = False
mark.close()