uscuni / simplification

Simplification of street network geometry
Other
6 stars 0 forks source link

test & fix for `geomtry.is_within()` #75

Closed jGaboardi closed 5 days ago

jGaboardi commented 1 week ago

This PR:

jGaboardi commented 1 week ago

@martinfleis the fix here for #74 has cascading effects on triangles.ipynb. From the last fixed_roads cell:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
File <timed exec>:1

File [~/github_repos/uscuni/simplification/core/algorithms/triangles.py:249](http://localhost:8888/~/github_repos/uscuni/simplification/core/algorithms/triangles.py#line=248), in resolve(roads, artifacts)
    246     case_2(edges, to_drop=to_drop)
    248 elif edges.coins_end.sum() == 2 and (edges.coins_count == 1).sum() == 0:
--> 249     case_5(
    250         edges,
    251         geom=geom,
    252         to_drop=to_drop,
    253         to_add=to_add,
    254         roads=roads,
    255         nodes=nodes,
    256     )
    258 elif edges.coins_end.sum() == 1 and (edges.coins_count == 1).sum() == 0:
    259     case_6(edges, to_drop=to_drop)

File [~/github_repos/uscuni/simplification/core/algorithms/triangles.py:126](http://localhost:8888/~/github_repos/uscuni/simplification/core/algorithms/triangles.py#line=125), in case_5(edges, geom, to_drop, to_add, roads, nodes)
    124     to_drop.extend(edges[edges.coins_group != main_group].index.to_list())
    125 else:
--> 126     to_drop.extend(edges[edges.coins_group != main_group].length.idxmin())

TypeError: 'numpy.int64' object is not iterable
jGaboardi commented 1 week ago

As for a once over comparison of the test plots in the notebook, Case 5.2 is the only one affected.

case_52

martinfleis commented 6 days ago

Case 5.2 is the only one affected.

mmm, that one should not be affected. We want the output on the left, not the one on the right.