> ## Content Index
> Fetch the complete content index at: https://www.daanalytics.nl/llms.txt
> Use this file to discover other available public pages before exploring further.

# Mapping Formula 1 Circuits with Python and Folium
- URL: https://www.daanalytics.nl/plotting-f1-circuit-locations-into-a-map-using-folium/
- Published: 2022-12-06T23:53:39.000Z
- Updated: 2026-09-06T09:53:30.000Z
- Author: Daan Bakboord
- Tags: Python & Streamlit, Snowflake, F1, Folium, Python

The notebook below is a continuation of a previous [blogpost](https://daanalytics.nl/loading-f1-historical-data-into-snowflake-using-the-ergast-developer-api/?ref=daanalytics.nl) where I started loading F1 Data into Snowflake ❄️ using the Ergast API. Next up is plotting this data on a map using [Folium](https://github.com/python-visualization/folium?ref=daanalytics.nl). Folium is a Python library used for visualizing Geospatial Data. \*"It builds on the data wrangling strengths of the Python ecosystem and the mapping strengths of the Leaflet.js library. Manipulate your data in Python, then visualize it in a Leaflet map via folium."\*

Follow the steps below to get things started.

- I use an [Anaconda](https://www.anaconda.com/?ref=daanalytics.nl) environment from where I have started Jupyter Lab.
- Next install all the necessary library's
- Import necessary library's
- Create a function to get a Continent based on the Country and
- Create a function to define the marker color based on the Continent
- Setting up a Snowflake connection
- After setting the connection to Snowflake it's time to connect to the database, verify the connection and get the data out of the Circuits-table
- Convert the Data output to a Pandas Data Frame so we can plot this Data on a Folium Map
- Create the Folium Map. In this example 3 different variants:
  - World Map
  - Continent Map (Europe)
  - Country Map (France)

[Bekijk code op GitHub Gist](https://gist.github.com/daanalytics/6450a809a3405018c4abbc468f8fda9b?ref=daanalytics.nl)

The above notebook results in the below maps.

#### World Map

![](https://www.daanalytics.nl/content/images/2022/12/Folium-World-Map-1024x614-2.png)

#### Continent Map (Europe)

![](https://www.daanalytics.nl/content/images/2022/12/Folium-Continent-Map-1024x614-2.png)

#### Country Map (France)

![](https://www.daanalytics.nl/content/images/2022/12/Folium-Country-Map-1024x614-2.png)

### Closing Statements

This example provided the steps to plot F1 Circuit Locations into a map using [Folium](https://www.daanalytics.nl/plotting-f1-circuit-locations-into-a-map-on-streamlit-using-folium/); a Python library used for visualizing Geospatial Data. Please check it out and let me know what you think. The code is on [Github](https://github.com/daanalytics/Snowflake/blob/master/python/F1FoliumCircuits.ipynb?ref=daanalytics.nl). In a next example I will covert this code into a [Streamlit](https://streamlit.io/?ref=daanalytics.nl) Application.

Till next time.

[Daan Bakboord – DaAnalytics](https://www.linkedin.com/in/daanbakboord?ref=daanalytics.nl)