Mapping with Python & Folium - Creating Maps from Raw CSV/JSON Data

17,876
0
Published 2023-01-12
In this video, we'll create Folium maps from raw CSV data in Python. We'll learn how to read in the data, transform it to extract the information we need (latitude/longitude), and create Folium maps based on this data.

The source data can be found here: catalog.data.gov/dataset/electric-vehicle-chargingโ€ฆ

We'll learn how to add Markers to the map, how to use popups to display text on markers, and how to cluster markers together dynamically using the FastMarkerCluster.

๐Ÿ“Œ ๐—–๐—ต๐—ฎ๐—ฝ๐˜๐—ฒ๐—ฟ๐˜€:
00:00 Intro
00:57 Reading CSV data into Python application
03:31 Using string manipulation to extract latitude/longitude
06:25 Creating a map using Folium
07:43 Adding Markers to the Folium map from the data
09:51 Adding popups displaying text on the Folium markers
10:36 Clustering markers with the FastMarkerCluster

โ–ถ๏ธ Full Playlist:
ย ย ย โ€ขย Geospatialย Pythonย ย 

โ˜•๏ธ ๐—•๐˜‚๐˜† ๐—บ๐—ฒ ๐—ฎ ๐—ฐ๐—ผ๐—ณ๐—ณ๐—ฒ๐—ฒ:
To support the channel and encourage new videos, please consider buying me a coffee here:
ko-fi.com/bugbytes

๐—ฆ๐—ผ๐—ฐ๐—ถ๐—ฎ๐—น ๐— ๐—ฒ๐—ฑ๐—ถ๐—ฎ:
๐Ÿ“– Blog: www.bugbytes.io/posts/
๐Ÿ‘พ Github: github.com/bugbytes-io/
๐Ÿฆ Twitter: twitter.com/bugbytesio

๐Ÿ“š ๐—™๐˜‚๐—ฟ๐˜๐—ต๐—ฒ๐—ฟ ๐—ฟ๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด ๐—ฎ๐—ป๐—ฑ ๐—ถ๐—ป๐—ณ๐—ผ๐—ฟ๐—บ๐—ฎ๐˜๐—ถ๐—ผ๐—ป:
Dataset: catalog.data.gov/dataset/electric-vehicle-chargingโ€ฆ
Folium: python-visualization.github.io/folium/
FastMarkerCluster: python-visualization.github.io/folium/plugins.htmlโ€ฆ

#python #gis #mapping #datascience

All Comments (18)
  • Iโ€™ve used Plotly for previous projects but havenโ€™t tried Folium yet but I will be checking this out now. Easy functions to create a dynamic map and clustering with a single line is a great bonus. The only real task may be formatting data which is still not bad. Thank you and hope you had a nice holiday!
  • @bgrantcooper
    You provide really good clear explanations that I learn from every time I watch your videos. So glad I stumbled across them one day and started watching. Thank you.
  • @saugat_lm10
    Is there a way to add a dropdown or an option in the produced map to just select a few stations and only display them? I am doing a similar project but I need to be able to filter the popups as there are too many of them to be shown together.
  • How can we plot live marker's coordinates? in my case the csv file updates the lat and lon every 1 minute
  • Hola, good... but, if you need update information in popup. popup=folium.Popup(folium.IFrame('Site_name: ' + str(row.site_name) + '
    ' + 'Azimuth: ' + str(row.azimuth) + '
    ' + 'Height: ' + str(row.height) + '
    ' + 'Bands: ' + str(row.band)), min_width=400, max_width=1000) and height it takes different values and corresponds to different heights and bands. how to output such information for a single marker?
  • @skyful9
    Can we add or show statistics on a specific area?
  • Hi I keep getting this error while trying to perform this code: KeyError Traceback (most recent call last) Input In [46], in () 2 reader = csv.DictReader(csvfile) 3 for row in reader: ----> 4 records.append({key: row[key] for key in keys}) Input In [46], in (.0) 2 reader = csv.DictReader(csvfile) 3 for row in reader: ----> 4 records.append({key: row[key] for key in keys}) KeyError: 'Station Name'
  • @sourab_garg
    when i add tiles in folium maps i am getting "these basemap maps will no longer available from 31 oct 2023 in python"
  • @PKX1167
    Hello nice video and excelent explanation. How can i get in contact you you?
  • @kavustock
    Okay, how do we add the Station Name as the popup when using FastMarkerCluster?