Uncomment the following line to install leafmap if needed.
# !pip install leafmap
To follow this tutorial, you will need to sign up for an account with https://datapane.com, then install and authenticate the datapane
Python package. More information can be found here.
pip install datapane
datapane login
datapane ping
import leafmap.foliumap as leafmap
Create an elevation map of North America.
m = leafmap.Map()
m.add_basemap("USGS 3DEP Elevation")
colors = ["006633", "E5FFCC", "662A00", "D8D8D8", "F5F5F5"]
vmin = 0
vmax = 4000
m.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)
m
Publish the map to datapane.com
m.publish(name="Elevation Map of North America")
Create a land use and land cover map.
m = leafmap.Map()
m.add_basemap("NLCD 2016 CONUS Land Cover")
m.add_legend(builtin_legend="NLCD")
m
Publish the map to datapane.com.
m.publish(name="National Land Cover Database (NLCD) 2016")
Create a world population heat map.
m = leafmap.Map()
in_csv = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/world_cities.csv"
m.add_heatmap(
in_csv,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
colors = ["blue", "lime", "red"]
vmin = 0
vmax = 10000
m.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)
m
Publish the map to datapane.com.
m.publish(name="World Population Heat Map")