diff --git a/docs/src/pages/rustalgos/rustalgos.md b/docs/src/pages/rustalgos/rustalgos.md index 9c1c29c3..0afe23fe 100644 --- a/docs/src/pages/rustalgos/rustalgos.md +++ b/docs/src/pages/rustalgos/rustalgos.md @@ -2736,12 +2736,12 @@ datapoints are not located with high spatial precision. -node_xys: list[tuple[float, float]] +node_lives: list[bool] -node_lives: list[bool] +node_xys: list[tuple[float, float]] diff --git a/docs/src/pages/tools/graphs.md b/docs/src/pages/tools/graphs.md index 14de5245..166c4e71 100644 --- a/docs/src/pages/tools/graphs.md +++ b/docs/src/pages/tools/graphs.md @@ -15,16 +15,11 @@ layout: ../../layouts/PageLayout.astro
-nx_simple_geoms
+nx_simple_geoms
(
nx_multigraph
-
- simplify_dist - : - int = 5 -
)
@@ -42,16 +37,6 @@ layout: ../../layouts/PageLayout.astro A `networkX` `MultiGraph` with `x` and `y` node attributes.
-
-
-
simplify_dist
-
int
-
-
- - Simplification distance to use for simplifying the linestring geometries.
-
- ### Returns
diff --git a/tests/tools/test_graphs.py b/tests/tools/test_graphs.py index 787488c9..a302ccc1 100644 --- a/tests/tools/test_graphs.py +++ b/tests/tools/test_graphs.py @@ -308,36 +308,30 @@ def test_nx_iron_edges(): nx_multi.add_node(0, x=0, y=0) nx_multi.add_node(1, x=0, y=2) # 1 - straight line should be simplified - line_geom = geometry.LineString([[0, 0], [0, 100], [0, 200]]) + line_geom = geometry.LineString([[0, 0], [0, 10], [0, 20]]) nx_multi.add_edge(0, 1, geom=line_geom) nx_out = graphs.nx_iron_edges(nx_multi) out_geom = nx_out[0][1][0]["geom"] - assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 200.0)] + assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 20.0)] # 2 - jogged line should be preserved - line_geom = geometry.LineString([[0, 0], [0, 100], [100, 100], [100, 200]]) + line_geom = geometry.LineString([[0, 0], [0, 10], [10, 10], [10, 20]]) nx_multi[0][1][0]["geom"] = line_geom nx_out = graphs.nx_iron_edges(nx_multi) out_geom = nx_out[0][1][0]["geom"] - assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 100.0), (100.0, 100.0), (100.0, 200.0)] + assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 10.0), (10.0, 10.0), (10.0, 20.0)] # 3 sharply jogged line should be simplified - line_geom = geometry.LineString([[0, 0], [0, 100], [100, 50], [100, 200]]) + line_geom = geometry.LineString([[0, 0], [10, 0], [15, 10], [15, 0]]) nx_multi[0][1][0]["geom"] = line_geom nx_out = graphs.nx_iron_edges(nx_multi) out_geom = nx_out[0][1][0]["geom"] - assert list(out_geom.coords) == [(0.0, 0.0), (100.0, 200.0)] + assert list(out_geom.coords) == [(0.0, 0.0), (15.0, 0.0)] # 4 folded back line should be simplified - line_geom = geometry.LineString([[0, 0], [0, 300], [0, 200]]) + line_geom = geometry.LineString([[0, 0], [0, 30], [0, 20]]) nx_multi[0][1][0]["geom"] = line_geom nx_out = graphs.nx_iron_edges(nx_multi) out_geom = nx_out[0][1][0]["geom"] - assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 200.0)] - # 5 short line should be simplified - line_geom = geometry.LineString([[0, 0], [10, 100], [0, 200]]) - nx_multi[0][1][0]["geom"] = line_geom - nx_out = graphs.nx_iron_edges(nx_multi) - out_geom = nx_out[0][1][0]["geom"] - assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 200.0)] - # 6 loops should be left alone + assert list(out_geom.coords) == [(0.0, 0.0), (0.0, 20.0)] + # 5 loops should be left alone nx_multi = nx.MultiGraph() nx_multi.add_node(0, x=0, y=0) line_geom = geometry.LineString([[0, 0], [0, 100], [100, 100], [100, 0], [0, 0]])