Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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