In [ ]:
%matplotlib inline
from matplotlib import pylab as plt
from matplotlib.colors import LinearSegmentedColormap
from geonotebook.wrappers import RasterData
from IPython.display import display, Image

Unstyled RGB Layer


In [ ]:
EXPECTED="https://data.kitware.com/api/v1/file/586a8f688d777f1e3428d849/download"
# Set the center of the map to the location the data
M.set_center(-120.32, 47.84, 8)

# Clean up any layers that might already exist
for l in M.layers:
    M.remove_layer(l)

rd = RasterData('data/WELD.tif')

M.add_layer(rd[1, 2, 3])

display(Image(EXPECTED, format="png"))

Unstyled NDVI Layer


In [ ]:
EXPECTED="https://data.kitware.com/api/v1/item/586a8fc98d777f1e3428d84b/download"

M.set_center(-120.32, 47.84, 8)
M.layers.annotation.clear_annotations()
for l in M.layers:
    M.remove_layer(l)

rd = RasterData('data/WELD.tif')
M.add_layer(rd[4])

display(Image(EXPECTED, format="png"))
# TODO: Add image for comparison

Winter Colormap w/ NDVI Layer


In [ ]:
EXPECTED="https://data.kitware.com/api/v1/item/586a902c8d777f1e3428d84e/download"

M.set_center(-120.32, 47.84, 8)
for l in M.layers:
    M.remove_layer(l)

rd = RasterData('data/WELD.tif')

# Create Colormap
cmap = plt.get_cmap('winter', 10)

M.add_layer(rd[4], colormap=cmap)

display(Image(EXPECTED, format="png"))

Custom Colormap w/ NDVI Layer


In [ ]:
EXPECTED="https://data.kitware.com/api/v1/item/586a90a08d777f1e3428d851/download"

M.set_center(-120.32, 47.84, 8)
for l in M.layers:
    M.remove_layer(l)

rd = RasterData('data/WELD.tif')

cmap =LinearSegmentedColormap.from_list(
  'ndvi', ['blue', 'beige', 'green'], 20)

M.add_layer(rd[4], colormap=cmap)

display(Image(EXPECTED, format="png"))