Folium mapping from CSV file

by Dane Miller

This is some graduate school field data collecting different species conifer cones. Here is a link to that publication:

https://www.sciencedirect.com/science/article/pii/S0033589414000738

Creating interactive maps with multiple latitude and longitude coordinates. The folium mapping module is very powerful and interactive.

Here is a link to the interactive map. The map allows you to zoom in and scroll over the cloud icons for additional information.
Conifer_Map

import folium
from folium import plugins
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

%matplotlib inline
df = pd.read_csv('/.../gradcone.csv')
df.head()

I set the start point of this map at Kenosha Pass, Colorado. I could have easily put in a different location.

m = folium.Map([39.4133, -105.7567], zoom_start=5)
m

Make sure you specify row (lat and long) and in popup additional information you want to include.

for index, row in df.iterrows():
    folium.Marker([row['Latitude'], row['Longitude']], 
                  popup=row['Location'],
                  icon=folium.Icon(icon='cloud')
                 ).add_to(m)
m
m.save('/.../map4.html')
# in order for the map to popup on in jupyter notebook comment out the m.save. 

If you are interested in digging into folium mapping with python take a look at the links below.
http://folium.readthedocs.io/en/latest/index.html
https://alysivji.github.io/getting-started-with-folium.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s