Created
April 18, 2016 17:25
-
-
Save deparkes/a202c31809771facad1f208e00fede5a to your computer and use it in GitHub Desktop.
Code to generate an interactive map of Colchester public toilets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import folium | |
import pandas as pd | |
from bng_to_latlon import OSGB36toWGS84 | |
os.chdir("C:\Users\Duncan\Documents\Python Scripts\pythonGIS") | |
# Load map centred on Colchester | |
uk = folium.Map(location=[51.8860942,0.8336077], zoom_start=10) | |
# Load locally stored colchester public toilets data | |
toilets = pd.read_csv("public-toilets.csv") | |
#add a marker for each toilet | |
for each in toilets.iterrows(): | |
print(list([each[1].GeoY,each[1].GeoX])) | |
print(list(OSGB36toWGS84(each[1]['GeoX'],each[1]['GeoY']))) | |
folium.Marker(list(OSGB36toWGS84(each[1]['GeoX'],each[1]['GeoY'])), popup=each[1]['StreetAddress']).add_to(uk) | |
# Save map | |
uk.save("./colch_toilets.html") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment