mirror of
https://github.com/bellingcat/geoclustering.git
synced 2026-06-07 19:18:30 +03:00
@@ -50,6 +50,8 @@ Options:
|
||||
Clustering algorithm to be used. `optics`
|
||||
produces tighter clusters but is slower.
|
||||
Default: dbscan
|
||||
--open Open the generated visualization in the
|
||||
default browser automatically.
|
||||
--help Show this message and exit.
|
||||
```
|
||||
|
||||
|
||||
@@ -38,8 +38,13 @@ import geoclustering.io as io
|
||||
default="dbscan",
|
||||
help="Clustering algorithm to be used. `optics` produces tighter clusters but is slower. Default: dbscan",
|
||||
)
|
||||
@click.option(
|
||||
"--open",
|
||||
is_flag=True,
|
||||
help="Open the generated visualization in the default browser automatically.",
|
||||
)
|
||||
@click.argument("filename", type=click.Path(exists=True))
|
||||
def main(distance, size, output, filename, algorithm):
|
||||
def main(distance, size, output, filename, algorithm, open):
|
||||
df = io.read_csv_file(filename)
|
||||
|
||||
clusters = clustering.cluster_locations(
|
||||
@@ -57,7 +62,8 @@ def main(distance, size, output, filename, algorithm):
|
||||
io.write_output_file(output, "result.geojson", encoded["geojson"])
|
||||
vis = io.write_visualization(output, "result.html", encoded["geojson"])
|
||||
|
||||
webbrowser.open_new_tab("file://" + str(vis.absolute()))
|
||||
if open:
|
||||
webbrowser.open_new_tab("file://" + str(vis.absolute()))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user