Skip to content

Instantly share code, notes, and snippets.

@loopingleo
Last active September 3, 2018 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loopingleo/1c8127b7bcbdb2c870e67a0b64fad7b5 to your computer and use it in GitHub Desktop.
Save loopingleo/1c8127b7bcbdb2c870e67a0b64fad7b5 to your computer and use it in GitHub Desktop.
## ---------- PLOT ON Google MAP ----------------------------
gmap = gmplot.GoogleMapPlotter(df_compressed.lat.mean(), df_compressed.lon.mean(), 14)
#plot map circles in different sizes (and colors)
for i in range(0,len(df_compressed)-1,20):
if abs(df_compressed.speed[i]) < 3/3.6:
gmap.circle(df_compressed['lat'][i], df_compressed['lon'][i],
color="#f44242",
marker=False,
radius= 20 * (df_compressed["speed"][i])**(2),
#radius = 10,
ew = 0.3,
face_alpha=0.8,
)
#gmap.scatter(df['Latitude'], df['Longitude'], df["markColScale"][i], size=0.5, marker=False)
#gmap.heatmap(df_compressed['lat'], df_compressed['lon'], threshold=5, radius=40)
gmap.draw("your_map_filename.html") # saves to html file for display - open file in your browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment