Using Folium for your geo-data.

A quick guide to plot your latitude and longitudes.

Today I want to bring you a quick tutorial for when you have some geodata and don’t know what to do or what does it look like! You can check out Folium’s GitHub here.

Let’s start by installing folium.

pip install folium

In this case, I will use a dataset that contains the Latitude and Longitude of houses in the Seattle, WA area.

We’ll begin by importing folium and crating the folium object.

We use the location parameter to select where we want the map to be focused on, then we provide the zoom start which like any map it’s how zoomed in we want the map to appear when plotted, here, the larger the number the further away it will appear from the location provided.

Next, we need to plot each marker on the map. We use the circlemarker() object and add them one by one to the map. To make this process easier, we’ll use a For loop.

The location parameter takes the latitude and longitude in list form and the radius is the size of the marker. You can make it as large or small as you want, I want them to appear as dots so I made them small.

Finally, we call the map by using the name of the variable we stored the folium object.

And the result will be an interactive map that you’re able to scroll to zoom in and out and you’re able to see in detail the streets and explore where every location is plotted!

And here’s a quick gif demonstration!

And there you go! a quick plot of your geodata!

A Data Scientist in the making!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store