Geospatial Analysis and Plotting with Folium

Sameed Ahmed Khan
2 min readAug 22, 2021

--

Geospatial Analysis is useful in discovering patterns, trends, density in a certain region.
With the help of python, we can easily clean the data, extract insights, and create interactive visualizations allowing us to easily observe the patterns.

In this tutorial, we will be plotting the average temperatures from 1996–2001 in the North Pacific Ocean near Channel Islands National Park and Catalina Island Essential Fish Habitat Conservation Area.

Let’s start off by importing the required libraries and loading the data.

In order to load the map in the proper region, let’s find the mean latitude and longitude.

After that, we will reduce the data and pick the columns we are interested in, and get some insights about the data.

Now, we will define functions that will help us plot the maps. In folium.Map, we have zoom_start as 6 as it was enough to show all the pins on the map. Also, we are setting location to be the average of latitude and longitude so that our map is loaded with the region we are interested in.
folium.Marker takes as input the coordinates and the text to show in case that marker is clicked.

And now it’s time to call the functions with proper input and plot the maps.

In a very similar task, we will try to plot the depth of the ocean.

For this, we will be performing the following steps.
1. Import Libraries
2. Read the data and get some insights
3. Find mean of Latitude and Longitude
4. Define functions to plot the data
5. Plot the map

Geospatial analysis is always fun. And I am always amazed to explore about the wonders we can do with that.
It was just a simple introduction but I am sure it was interesting. 🙂

You can find the codes on Github, and feel free to connect with me on Linkedin.

I will also try to post more stuff on geospatial analysis soon.

--

--

Sameed Ahmed Khan
Sameed Ahmed Khan

Written by Sameed Ahmed Khan

Sameed is an adept Machine Learning Engineer who is keen on exploring the depths of AI. He loves writing about technology, data ethics & interesting projects.

No responses yet