Skip to content

Instantly share code, notes, and snippets.

@ShayanRiyaz
Created April 24, 2020 10:29
Show Gist options
  • Save ShayanRiyaz/26d02748f03d7f1db269a68e0baf5852 to your computer and use it in GitHub Desktop.
Save ShayanRiyaz/26d02748f03d7f1db269a68e0baf5852 to your computer and use it in GitHub Desktop.
address = 'Los Angeles, USA'
geolocator = Nominatim(user_agent="la_explorer")
location = geolocator.geocode(address)
latitude = location.latitude
longitude = location.longitude
print('The geograpical coordinates of {} are {}, {}.'.format(address,latitude, longitude))
# create map of LA using latitude and longitude values
map_la = folium.Map(location=[latitude, longitude], zoom_start=10)
# add markers to map
for lat, lng, neighbourhood in zip(nhoods['Latitude'], nhoods['Longitude'], nhoods['Neighbourhood']):
label = '{}'.format(neighbourhood)
label = folium.Popup(label, parse_html=True)
folium.CircleMarker(
[lat, lng],
radius=3,
popup=label,
color='red',
fill=True,
fill_color='#3199cc',
fill_opacity=0.3,
parse_html=False).add_to(map_la)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment