Part II : Extracting Fourquare Data

Jump to :

  • Part 1 Extracting Street Addresses & Coordinates
  • Part 3 , Exploratory Data Analysis
  • Part 4, Clustering and Visualising
  • Part 5, Conclusion & Discussion

1. Set up environment

In [9]:
import pandas as pd
import numpy as np
import folium
import requests
import re
In [2]:
streetData = pd.read_csv('./streetData_Midcoordinates.csv')

2. Basic Folium Map visualisation

In [3]:
streetData.head()
Out[3]:
Street MidLatitude MidLongitude
0 Charlotte Andersens vei 59.940584 10.696497
1 Heggelibakken 59.938909 10.692733
2 Forskningsveien 59.943733 10.713100
3 Risveien 59.946870 10.704020
4 Sandermosveien 60.019786 10.793857
In [5]:
#1.2.1 Make map with street info
latitude = 59.9133301
longitude = 10.7389701
map_oslo = folium.Map(location=[latitude, longitude], zoom_start=10)

# add markers to map
for lat, lng, street , in zip(streetData['MidLatitude'], streetData['MidLongitude'],
                                                      streetData['Street']):
    
    #Create pop-up label to display
    label = '{}'.format(street)#neighborhood, borough originally
    label = folium.Popup(label, parse_html=True)
    folium.CircleMarker(
        [lat, lng],
        radius=2,#Change radius of circle marker
        popup=label,
        color='blue',
        fill=False,
        #fill_color='#3186cc',
        fill_opacity=0.7,
        parse_html=False).add_to(map_oslo)  
    
map_oslo
Out[5]: