Sample custom collection to visualize an RGB composition for a Landsat image¶

An example of a "custom" collection built on Landsat images. In this case, every band is phisically stored in a differend file on the storage ("type": "SB" means "Single Band Files"). In order to visualize an RGB composition it's needed to describe in the JSON string that defines the collection what are the names of the band files and their file extension ("tif" for landsat). The full path of the image files is constructed by putting together the path, plus the band name, plus dot, plus the file extension.
Please note that the creation of the custom collection requires few seconds to calculate the statistics for the images that are part of the collection.

In [ ]:
map = Map(center=[50, -89],zoom=6)
map
In [ ]:
str = '{"size": 1, "0": {"epsg": 32616, "bnames":["10", "20", "30", "40"], "type": "SB", "ext": "tif", "path":\
"/eos/jeodpp/data/SRS/USGS/GLCF/GLS2000/LATEST/source/p025/r025/p025r025_7dx20010605.ETM-GLS2000/p025r025_7dt20010605_z16_"} }'
cust = inter.ImageCollection("CUSTOM")
cust.setCustom(str)

A processing object is created starting from the custom collection to display an RGB composition of bands 30, 20, and 10.
The processing object is added as a new layer to the map.

In [ ]:
p = cust.process().bands("30","20","10", 2.0)
map.clear()
tlayer = map.addLayer(p.toLayer())

Identifying pixel values by moving a marker on the map¶

Using ipyWidgets we can create a label and associate it to the identify operator that can be used to inspect the pixel values of the displayed image.

In [ ]:
from ipywidgets import widgets
from IPython.display import display
label = widgets.Label(layout=widgets.Layout(width='100%'))
display(label)
mark = inter.identify(map,p,label)
In [ ]: