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

Overlapping intersections #109

Open
vvoovv opened this issue Sep 2, 2024 · 2 comments
Open

Overlapping intersections #109

vvoovv opened this issue Sep 2, 2024 · 2 comments

Comments

@vvoovv
Copy link
Member

vvoovv commented Sep 2, 2024

I'd like to discuss the overlapping intersections, like the one below:

image

As far as I remember, there was a solution for that problem in earlier development.

@polarkernel
Copy link
Collaborator

As far as I remember, there was a solution for that problem in earlier development.

Well, more or less. The methods were based on the area polygons of the intersections. There were two levels of overlap detection. Both then combined overlapping intersection areas by computing the geometric union of the intersection areas.

The first detection method used the PolyLine trim parameters trimS and trimT of a section, that was available after the intersection area was calculated. These describe the amount of trimming required to fit a section to the connector of the intersection area (see below left).

If trimS < trimT, there is no conflict. When trimS > trimT, as shown on the right, the areas conflict and must be merged. This was the case when we talked about short streets. These calculations were done in the old Intersection class (/legacy/intersection.py) and at the end of the createIntersectionAreas() method of StreetGenerator (starting at line 2221 of /legacy/generate_streeets.py). The conflicting areas were stored pairwise in a DisjointSets data structure, so that groups of conflicts could be found later.

The second detection method checked neighboring intersection areas for geometric intersections. There may be overlaps between intersections, that are not connected by streets. It was implemented in the mergeOverlappingIntersections() method of StreetGenerator (starting at line 2313 of /legacy/generate_streeets.py). To efficiently find neighboring intersection areas, they were put into a static index (class StaticSpatialIndex). The test for intersections was done with the intersection operator of boolPolyOp. Again, the conflicting areas were stored pairwise in a DisjointSets data structure.

The conflicting areas (there can be more than two in one group) were finally merged by the mergeConflictingAreas() method of StreetGenerator (starting at line 2233 of /legacy/generate_streeets.py). The merging was done by an iteratively applied geometric union operator of boolPolyOp. Finally, the connectors of the merged intersection had to be ordered correctly.

Additionally, some bookkeeping for the streets was required. The pictures below show some results of this process. It resolved the conflicts, but was not yet really a solution.

@vvoovv
Copy link
Member Author

vvoovv commented Sep 3, 2024

Only overlapping of major intersections should be taken into account.

Since intersections are now generated in Geometry Nodes, it does not make sense to generate them twice: the first time for removing the overlapping and the second time in Geometry Nodes.

What if we simply check if there are other intersection nodes within a given radius from an intersection node in question and join the related intersections? This should be done after making Bundles and Bundle intersections. This check can be done for all intersection nodes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants