24 heatmap
In [1]:
Copied!
# !pip install leafmap
# !pip install leafmap
Specify the file path to the CSV. It can either be a file locally or on the Internet.
In [2]:
Copied!
filepath = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv"
filepath = "https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv"
Use the ipyleaflet plotting backend.
In [3]:
Copied!
import leafmap.leafmap as leafmap
import leafmap.leafmap as leafmap
Specify the latitude
, longitude
, and value
columns to create the heat map.
In [4]:
Copied!
m = leafmap.Map()
m.add_basemap("Stamen.Toner")
m.add_heatmap(
filepath,
latitude="latitude",
longitude='longitude',
value="pop_max",
name="Heat map",
radius=20,
)
m
m = leafmap.Map()
m.add_basemap("Stamen.Toner")
m.add_heatmap(
filepath,
latitude="latitude",
longitude='longitude',
value="pop_max",
name="Heat map",
radius=20,
)
m
Use the folium plotting backend.
In [5]:
Copied!
import leafmap.foliumap as leafmap
import leafmap.foliumap as leafmap
Specify the latitude
, longitude
, and value
columns to create the heat map.
In [6]:
Copied!
m = leafmap.Map(tiles='stamentoner')
m.add_heatmap(
filepath,
latitude="latitude",
longitude='longitude',
value="pop_max",
name="Heat map",
radius=20,
)
m
m = leafmap.Map(tiles='stamentoner')
m.add_heatmap(
filepath,
latitude="latitude",
longitude='longitude',
value="pop_max",
name="Heat map",
radius=20,
)
m
Out[6]:
Make this Notebook Trusted to load map: File -> Trust Notebook
Last update:
2022-03-14