Created
November 1, 2015 04:27
-
-
Save wagamama/8738cb3c895c911f98eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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