Uncomment the following line to install leafmap if needed.
# !pip install leafmap
import leafmap
Get the Census data WMS tiles as a dictionary. More info can be found at https://tigerweb.geo.census.gov/tigerwebmain/TIGERweb_wms.html
census_data_dict = leafmap.get_census_dict()
Print out the list of US Census WMS.
for key in census_data_dict:
print(key)
Get the list of layers for a WMS.
census_data_dict["Census 2020"]["layers"]
Create an interactive map and add Census data layer to it. You might need to zoom in to see the data layer
m = leafmap.Map()
m.add_census_data(wms="Census 2020", layer="States")
m.add_census_data(wms="Census 2020", layer="States_Labels49388")
m
Alternatively, you can use the toolbar to load Census data interactively without coding.