In addition to the pre-defined image collections, users can create "custom" collection to be displayed on the map. This sample notebook presents a simple custom collection created from an image containing categorical data regarding soil types [http://www.fao.org/soils-portal/soil-survey/soil-maps-and-databases/harmonized-world-soil-database-v12/].
The custom collection can be created from a string containing the JSON description of the images to display. In this case a "minimal" JSON is used, where only a single image is listed with it's EPSG code.
A random color scheme is then used to display the image.
map = Map()
map
jstr = '{"size": 1, "values": "CAT", "0": {"epsg": 4326, "path":"/eos/jeodpp/data/base/Soil/GLOBAL/HWSD/VER1-2/Data/GeoTIFF/hwsd.tif"} }'
cust = inter.ImageCollection("CUSTOM")
cust.setCustom(jstr)
p = cust.process().band("1").scale(1,100)
p.colorScheme("random")
map.clear()
tlayer = map.addLayer(p.toLayer())
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.
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)
mark.visible = False
mark.close()