Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

current loop logic breaks topology in certain scenarios #69

Closed
jGaboardi opened this issue Oct 27, 2024 · 2 comments · Fixed by #79
Closed

current loop logic breaks topology in certain scenarios #69

jGaboardi opened this issue Oct 27, 2024 · 2 comments · Fixed by #79
Assignees
Labels
bug Something isn't working

Comments

@jGaboardi
Copy link
Collaborator

jGaboardi commented Oct 27, 2024

Within:

  • nodes.induce_nodes()
  • nodes.remove_false_nodes()

see below


Putting this here from Discord:

may have found a bug in fix_topology() whereby if already fixed stuff is passed in, something happens inside that "un-fixes" it.

import geopandas, shapely, sgeop

p10 = shapely.Point(1,0)
p30 = shapely.Point(3,0)
p50 = shapely.Point(5,0)
p21 = shapely.Point(2,1)
p32 = shapely.Point(3,2)
p41 = shapely.Point(4,1)

line1030 = shapely.LineString((p10, p30))
line3050 = shapely.LineString((p30, p50))
line3041323130 = shapely.LineString((p30, p41, p32, p21, p30))

# input "roads" that already meet out simplified critera
frame = geopandas.GeoDataFrame(geometry=[line1030, line3050, line3041323130])
frame
                               geometry
0                 LINESTRING (1 0, 3 0)
1                 LINESTRING (3 0, 5 0)
2  LINESTRING (3 0, 4 1, 3 2, 2 1, 3 0)

Screenshot 2024-10-27 at 2 54 58 PM

fixed_topology = sgeop.nodes.fix_topology(frame)
fixed_topology
                                 geometry
0.0            LINESTRING (1 0, 3 0, 5 0)
3.0  LINESTRING (3 0, 4 1, 3 2, 2 1, 3 0)

Screenshot 2024-10-27 at 2 57 38 PM


xref #68

@jGaboardi jGaboardi added the bug Something isn't working label Oct 27, 2024
@jGaboardi jGaboardi self-assigned this Oct 27, 2024
@jGaboardi
Copy link
Collaborator Author

  • I have discovered 2 rough edges in fix_topology() (actual 1 in induce_nodes() and 1 in remove_false_nodes() within fix_topology()) that can lead to improper identification of loop endpoints that in turn can lead to incorrect topology. Both fixes are currently in the GH20_nodes_tests_fix_topology and tests are passing locally (macOS 14).
  • CI suite failing on 5/6 FUA, seemingly with only very minor differences.
  • Relavent chunks for the fixes here in induce_nodes() and here in remove_false_nodes().
  • Still need to add tests
  • I can either roll this stuff into #67 or make a fresh PR for it once #67 is merged.

@martinfleis
Copy link
Contributor

I'd keep this separately from #67

@jGaboardi jGaboardi changed the title potential for fix_topology() to actually break topology current loop logic breaks topology in certain scenarios Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants