Daanalytics

Plotting F1 Circuit Locations into a map on Streamlit Cloud using Folium

In my last blogpost I showed how to plot F1 Circuit Locations into a map using Folium on Streamlit. The idea is to switch between the World, a possible Continent and a possible Country. Check the video below.

Streamlit App – Plotting F1 Circuit Locations into a map on Streamlit Cloud using Folium

Streamlit Cloud

Next step would be setting things up in Streamlit Cloud. At time of writing my previous blogpost I ran into issues, which I was able to solve with the help of some experts on the forum.

Following the steps from the Streamlit documentation makes setting things up relatively straightforward.

Get started

First we have to create an account (or login to an existing account). Get started or log in. I connected my Github-account with Streamlit Cloud. This way I can upload my apps to Github. Changes to an app in Github are automatically reflected in Streamlit Cloud.

Deploy an app

Deploying an app is almost as easy as pointing to the right code on Github.

The connection to Snowflake from Streamlit Cloud are a little bit different. The connection details are in the Streamlit Cloud ‘Advanced settings’.

I slightly changed the code compared to my last blogpost. In the Python code the connection details are called as followed:

Special attention to the requirements.txt-file. Make sure you have the right (and in my case the latest) versions of the libraries you use in your code. I had a problem with my first version of the app because of a wrong version of the streamlit-folium library. Thanks to the experts on the forum. I was able to solve the problem and make the app work in the Streamlit Cloud.

Closing Statements

In the previous example(s) I provided the steps to plot F1 Circuit Locations into a map using Folium; a Python library used for visualizing Geospatial Data.

In the first example it was a very static version where I plotted the F1 Circuit Locations either for the World, Europe or France. These options were hardcoded in the notebook and showed after each other.

In the second example I added some interactivity with Streamlit. The idea was to switch between the World, a possible Continent and a possible Country based on selected radio buttons in the sidebar.

The third example shows the same setup but then from the Streamlit Cloud. The code is on GitHub.

Till next time.

Daan Bakboord – DaAnalytics

Bekijk ook:

Why didn't we see this coming?

Why didn’t we see this coming?

Early this month I attended the two days International Master Class in Strategic Intelligence executed by Rodenberg Tillman & Associates. If you’re really determined to move beyond simply gathering data and truly understand its strategic impact, this Master Class is designed for you. The Master Class is built around the Six Building Blocks™, ensuring comprehensive coverage of the critical aspects of Strategic Management and Intelligence. It’s perfect for business professionals who aim to excel by integrating Strategic Intelligence into their everyday practices, gaining the insights necessary to not only anticipate, but shape the future.

Lees verder »
Amsterdam User Group Meeting October 2024

Snowflake Dutch User Group – October 2024

Last night I had the privilege to organize a Snowflake ❄️ User Group in Snowflake’s Amsterdam Office.

Johan van der Kooij shared his experiences regarding optimizing Snowflake from a cost & performance perspective. He shared practical hints, as well as example queries, that you can use to optimize your Snowflake environment.

Lees verder »
Snowflake Data Cloud Summit - Wrap Up

Snowflake Snowflake Data Cloud Summit — Wrap Up

Snowflake Data Cloud Summit proved that after all this years the core idea remains the same and is still strong. Technology should serve and Snowflake makes things simple. One Single Unified Platform, one product and one engine. Ease of use and Govenance. Maximum efficiency and maximum simplicity.

Bring the processing of data to the data instead of the other way around. Snowflake as a Platform where you build and share your Data, Apps and AI Products. Your data never has to leave the Platform and Snowflake takes care of this Platform.

Lees verder »