Skip to content

Instantly share code, notes, and snippets.

@deparkes
Created April 18, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deparkes/a202c31809771facad1f208e00fede5a to your computer and use it in GitHub Desktop.
Save deparkes/a202c31809771facad1f208e00fede5a to your computer and use it in GitHub Desktop.
Code to generate an interactive map of Colchester public toilets
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