Raster
Lab 7 Raster data and static image overlay¶
In [1]:
Copied!
import temp_interpolation
import temp_interpolation
In [2]:
Copied!
m = temp_interpolation.Map(center=(40, -100), zoom=3)
m = temp_interpolation.Map(center=(40, -100), zoom=3)
In [3]:
Copied!
# Task 1: Add a raster layer to the map
filename = r"https://github.com/opengeos/datasets/releases/download/hydrology/dem.tif"
m.add_raster(filename, name="DEM", opacity=1, colormap="terrain")
# Task 1: Add a raster layer to the map
filename = r"https://github.com/opengeos/datasets/releases/download/hydrology/dem.tif"
m.add_raster(filename, name="DEM", opacity=1, colormap="terrain")
In [4]:
Copied!
# Task 2: Add a static image overlay on the map
m.add_image(
url="https://www.thepetexpress.co.uk/blog-admin/wp-content/uploads/2015/09/bordeaux-869020_1280.jpg",
name="Dog",
opacity=1,
bounds=[[43, -119], [45, -122]],
)
# Task 2: Add a static image overlay on the map
m.add_image(
url="https://www.thepetexpress.co.uk/blog-admin/wp-content/uploads/2015/09/bordeaux-869020_1280.jpg",
name="Dog",
opacity=1,
bounds=[[43, -119], [45, -122]],
)
In [5]:
Copied!
# Task 3: Add a video overlay on the map
m.add_video(
url="https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4",
bounds=[[37.56238816, -122.515963], [37.563391708, -122.5130939]],
name="Drone Video",
opacity=0.8,
)
# Task 3: Add a video overlay on the map
m.add_video(
url="https://static-assets.mapbox.com/mapbox-gl-js/drone.mp4",
bounds=[[37.56238816, -122.515963], [37.563391708, -122.5130939]],
name="Drone Video",
opacity=0.8,
)
In [6]:
Copied!
# Task 4: Add a wms layer overlay on the map
m.add_wms_layer(
url="https://www.mrlc.gov/geoserver/ows?",
layers="mrlc_display:NLCD_2021_Land_Cover_L48",
name="NLCD Land Cover",
format="image/png",
transparent=True,
version="1.1.0",
attribution="NLCD Land Cover",
opacity=1,
)
m.add_layer_control()
m
# Task 4: Add a wms layer overlay on the map
m.add_wms_layer(
url="https://www.mrlc.gov/geoserver/ows?",
layers="mrlc_display:NLCD_2021_Land_Cover_L48",
name="NLCD Land Cover",
format="image/png",
transparent=True,
version="1.1.0",
attribution="NLCD Land Cover",
opacity=1,
)
m.add_layer_control()
m
Out[6]: