Created
August 19, 2018 14:47
-
-
Save joaofig/216f04728d05a57e1ba2ed1653200aaa to your computer and use it in GitHub Desktop.
Create DBSCAN bubbles
This file contains hidden or 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
# Create the list of cluster blobs | |
from shapely.ops import cascaded_union | |
clusters = list() | |
blobs = list() | |
counts = list() | |
for cluster_id, points in groups: | |
if cluster_id >= 0: | |
buffer_radius = eps_in_meters * 0.6 | |
buffers = [buffer_in_meters(lon, lat, buffer_radius) for lon, lat in zip(points['Longitude'], points['Latitude'])] | |
blob = cascaded_union(buffers) | |
blobs.append(blob) | |
clusters.append(cluster_id) | |
counts.append(len(points)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment