Heatmap
Creating heatmaps with beamgis¶
In [1]:
Copied!
# !pip install beamgis
# !pip install beamgis
In [2]:
Copied!
import beamgis
import beamgis
In [3]:
Copied!
# Define the file URL for the dataset containing US cities data
file = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/us_cities.csv"
# Define the file URL for the dataset containing US cities data
file = "https://raw.githubusercontent.com/opengeos/leafmap/master/examples/data/us_cities.csv"
using leafmap to inspect the data¶
In [4]:
Copied!
import leafmap
import leafmap
In [5]:
Copied!
# df = leafmap.csv_to_df(file)
# df.head()
# df = leafmap.csv_to_df(file)
# df.head()
In [6]:
Copied!
# Create a map and add a heatmap layer
m = beamgis.Map(center=(37.5, -96), zoom=4)
m.add_heatmap(
file,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
m
# Create a map and add a heatmap layer
m = beamgis.Map(center=(37.5, -96), zoom=4)
m.add_heatmap(
file,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
m
Out[6]:
Creating heatmap in folium¶
In [7]:
Copied!
# Import the foliumap module from beamgis for creating maps
import beamgis.foliumap as beamgis
# Import the foliumap module from beamgis for creating maps
import beamgis.foliumap as beamgis
In [8]:
Copied!
# Create a map centered at the specified coordinates with a zoom level of 4
m = beamgis.Map(center=(37.5, -96), zoom=4)
# Add a heatmap layer to the map using the dataset from the 'file' variable
# The heatmap uses latitude and longitude for positioning and 'pop_max' for intensity
m.add_heatmap(
file,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
# Display the map
m
# Create a map centered at the specified coordinates with a zoom level of 4
m = beamgis.Map(center=(37.5, -96), zoom=4)
# Add a heatmap layer to the map using the dataset from the 'file' variable
# The heatmap uses latitude and longitude for positioning and 'pop_max' for intensity
m.add_heatmap(
file,
latitude="latitude",
longitude="longitude",
value="pop_max",
name="Heat map",
radius=20,
)
# Display the map
m
Out[8]:
Make this Notebook Trusted to load map: File -> Trust Notebook