-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path00-mwe.py
33 lines (28 loc) · 1.31 KB
/
00-mwe.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""Minimum working example for superblockify."""
# While this script is running, figures will be generated on screen.
# Close the figure windows to proceed with the script execution.
# A data/ folder will be created in the current working directory.
from superblockify import ResidentialPartitioner
if __name__ == "__main__":
# --- Initialize the partitioner ---
partitioner = ResidentialPartitioner(
name="Scheveningen_test", # result folder: .data/results/Scheveningen_test/
city_name="Scheveningen", # cache: .data/graphs/Scheveningen.graphml
search_str="Scheveningen, NL",
unit="time",
# "time", "distance", any other edge attribute, or None to count edges
)
# If you want to select a different city, find the corresponding search string
# (`search_str`) at https://nominatim.openstreetmap.org/.
# The smaller the place, the quicker the partitioning.
# For large places sufficient memory is required.
# --- Run the partitioner ---
partitioner.run(
calculate_metrics=True,
make_plots=True,
replace_max_speeds=False,
)
# --- Save the partitioner ---
# Save it to disk, with all attributes, without an extra copy of the
# graph. The original graph has been cached in the data/graphs folder.
partitioner.save()