Skip to content

Instantly share code, notes, and snippets.

@wagamama
Created November 1, 2015 04:27
Show Gist options
  • Select an option

  • Save wagamama/8738cb3c895c911f98eb to your computer and use it in GitHub Desktop.

Select an option

Save wagamama/8738cb3c895c911f98eb to your computer and use it in GitHub Desktop.
import folium
import xmltodict
TPE_COORDINATES = (25.0375167, 121.5637)
map_tpe = folium.Map(location=TPE_COORDINATES, zoom_start=12)
with open('freeWifi.xml') as fd:
toilet = xmltodict.parse(fd.read())
toilet = toilet['soap:Envelope']['soap:Body']['GetToiletResponse']['GetToiletResult']['diffgr:diffgram']
for each in toilet['NewDataSet']['Table']:
lat, lon = each['Lat'], each['Lng']
text = ', '.join((each['Title'], each['Content']))
map_tpe.simple_marker(location=(lat, lon), popup=text, clustered_marker=True)
map_tpe.create_map('toilet.html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment