Skip to content

Instantly share code, notes, and snippets.

@samerlahoud
Created February 11, 2018 09:44
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 samerlahoud/f893814265e7534d395000005329cbda to your computer and use it in GitHub Desktop.
Save samerlahoud/f893814265e7534d395000005329cbda to your computer and use it in GitHub Desktop.
RIPE Atlas Anchors Voronoi
#!/usr/bin/python
from scipy.spatial import Voronoi, voronoi_plot_2d
from ripe.atlas.cousteau import AnchorRequest
import mplleaflet
filters = {"status": 1}
anchors = AnchorRequest(**filters)
xy = []
# Grab the coordinates (longitude, latitude) of connected anchors
for anchor in anchors:
xy.append(anchor["geometry"]["coordinates"])
vor_polygon = Voronoi(xy)
voronoi_plot_2d(vor_polygon, show_vertices = False)
mapfile = 'anchor-voronoi-cells.html'
# Create the map. Save the file to html
mplleaflet.show(path=mapfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment