Skip to content

Instantly share code, notes, and snippets.

View jhurley13's full-sized avatar

John Hurley jhurley13

  • SF Bay Area
View GitHub Profile
@jhurley13
jhurley13 / create_circles_map.py
Last active May 8, 2020 06:24
Using Folium to create a map of 5 mile radius circles given data frame with latitude and longitude
def create_circles_map(group_center_pt, radius_in_miles = DEFAULT_CIRCLE_RADIUS):
circle_radius = 1000 * miles_to_kilometers(radius_in_miles)
circle_colors = ['red', 'yellow', 'lime', 'green', 'aqua', 'teal', 'blue', 'navy', 'fuchsia', 'purple']
mm = folium.Map(location=group_center_pt, zoom_start=11)
for ix, row in df5mr.iterrows():
location = (float(row['latitude']), float(row['longitude']))
_ = mm.add_child(folium.vector_layers.Circle(location, circle_radius, stroke=1,
color=circle_colors[ix % len(circle_colors)], opacity=0.5, dash_array='4 1'))
_ = mm.add_child(folium.LayerControl())
mm.save(outfile=sharpies_map_path.as_posix())

Keybase proof

I hereby claim:

  • I am jhurley13 on github.
  • I am jhurley (https://keybase.io/jhurley) on keybase.
  • I have a public key ASA-W8pQCHmHaHJIT5HHHtVl6W8cVoBqxQ6OTKCeTVRzOQo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jhurley13 on github.
  • I am jhurleyapio (https://keybase.io/jhurleyapio) on keybase.
  • I have a public key ASCuVOUd7HbA0QkDvZHfWIrfyn5XQ8Zlobe5_ZxLDLs5Cgo

To claim this, I am signing this object: