Minimum working example¶
This notebook runs a minimum working example with linkbikenet.
Import linkbikenet¶
The standard way of importing linkbikenet:
import linkbikenet as lbn
Run linkbikenet on example city¶
linked_components = lbn.linkbikenet("Frederiksberg municipality")
Explore results¶
See the contents of the resulting geodataframe:
linked_components.head()
| nodelist | edge_list | geometry | network_length | lcc_length | link_length | num_components_added | lcc_share | lcc_gain | ordering | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | None | None | None | 44248 | 37607 | 0 | 0 | 0.8499 | 0 | 0 |
| 1 | [286652484, 1222117998] | [(286652484, 1222117998)] | LINESTRING (12.50322 55.68449, 12.50319 55.684... | 44255 | 37673 | 6 | 1 | 0.8513 | 66 | 1 |
| 2 | [662904, 293886031] | [(662904, 293886031)] | LINESTRING (12.49542 55.67237, 12.49543 55.67247) | 44266 | 37759 | 11 | 1 | 0.8530 | 85 | 2 |
| 3 | [10813852125, 275095647] | [(275095647, 10813852125)] | LINESTRING (12.50603 55.68303, 12.50585 55.68306) | 44279 | 37856 | 12 | 1 | 0.8550 | 97 | 3 |
| 4 | [304136616, 1785193203] | [(1785193203, 304136616)] | LINESTRING (12.53111 55.67068, 12.53114 55.67084) | 44296 | 38202 | 17 | 1 | 0.8624 | 346 | 4 |
Explore the results interactively:
linked_components.explore(
tiles="https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.png",
attr="(C) Stadia Maps (C) OpenMapTiles (C) OpenStreetMap contributors",
style_kwds={"weight": 3, "color": "#096a51"},
)
Make this Notebook Trusted to load map: File -> Trust Notebook