Created
February 11, 2018 09:44
-
-
Save samerlahoud/f893814265e7534d395000005329cbda to your computer and use it in GitHub Desktop.
RIPE Atlas Anchors Voronoi
This file contains 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
#!/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