-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enabling Bundles and intersections with Bundles, produced in StreetGenerator #104
Comments
No. There you exclude them from the network completely. A restriction is made in the function If you like to experiment with exclusions of categories from the bundles, you may insert the following instruction at line 613 (current empty): if section.category in ['steps', 'footway', 'cycleway', 'path']:
continue However, I suggest that we do not change these criteria for the time being. I spent a lot of time fine-tuning them to get the best possible results. No matter what you do, you will always find another instance in some scene where it doesn't work. You will always find one of the observations I presented above, or another unexpected case. At least, that's my experience. By the way, parts of the algorithm are explained here.
There is a length limit in line 645. But to be honest, I don't remember the reason for that. Maybe to avoid short segments within intersections. |
I suggest that we consider for now only bundles with constant number of ways. For example a Bundle with 2 ways start at an intersection. The same 2 ways enter another intersection where the Bundle ends. Also I suggest that some intersections with the predefined conditions do not break a Street into 2 Streets. Here are some examples of those conditions:
|
Those intersections are local to the Street and can be collected in a list as a property of the Street. They are not included to the global list of intersections. |
I excluded the following categories in the line 614 of the method if section.category in ('steps', 'footway', 'cycleway', 'path', 'service'):
continue |
I committed a debug version to help understand the current state of development and discuss our proposals. This feature can be enabled in line 722 of /action/generate_streets.py, by setting It takes some patience to locate the interesting cases, but I think it's worth it. Scenes with a lot of interesting cases are: /osm_extracts/facade_visibility/bratislava_old_town.osm |
Thanks. BTW, /osm_extracts/facade_visibility/bratislava_old_town.osm is mentioned twice in your previous message. |
What do you think about my proposal of ignoring some intersections that satisfy the predefined conditions? |
Uuups, should have been /osm_extracts/facade_visibility/moscow_leningradski_prospekt.osm. I'll edit it in the original post. |
I agree.
I see the idea. This would definitively extend the bundle's lengths.
OK, for the bundle, but what happens with the intersections of these streets, when they leave the bundle, so that the intersection at one end is in this global list, while the other end is outside the bundle? What, if both ends are inside the bundle? Remove those ways? I am not sure if I understand your suggestion. I am currently studying the solutions I already found a long time ago, where the code is still in the class What is new, however, are the possibilities opened up by the use of geometric nodes. So solving your requirements may lead us to other, as yet undiscovered solutions. |
I suggest dividing our intersections into global and local ones. The global intersections are those in the existing data structure for the intersections. The global intersections define a street configuration on the ground. Typically a street configuration with the global intersections is very rarely changed on the ground. On the contrary, the local intersections do not change the street configuration on the ground and can be easily created on the ground. For example, a driveway to a new house, or a new pedestrian crossing in the middle of a street. A driveway (blue) on the image below does not change the street configuration (red)
It would also extend the length of ordinary streets (non-bundles).
I don't see any problems here. |
The intersection of the minor road and the upper Street in the Bundle will be included in the local list of intersections (or another appropriate data structure) of the upper Street in the Bundle. The intersection won't be available in global data structure of intersections. The upper Street should be compose of 3 Sections since the sections are separated by the local intersections. It will be provided as an instance of
Both ends of this minor street constitute local intersections in the same Bundle. So this minor street is also local to the Bundle. |
First a note. All these concepts also apply to single Streets (non-Bundles).
The Bundle is composed of 2 Streets. The upper Street is composed of 3 Sections separated by the minor intersections. The lower Street is composed of 2 Sections separated by the minor intersections.
I think they should be in a related Street:
Shouldn't the
Currently a Street does not have a local list
As noted above, Minor Intersections belong to a Street rather than to a Bundle. The Minor Intersections are inserted into the linked list of a Street.
I don't understand, why it is to lose its connection to the intersection. A Minor Intersection should have the same data structure as the Major one. |
Yes. I suggest using the tag
Sorry, I can't figure out what's new in the scheme.
If a Bundle is not connected to an Intersection, lets the attributes |
Both major and minor Sections with minor Intersections should be collected into longer Streets. Are there examples of major Sections which direction do not match? |
I really like your proposal! |
For now, I suggest concatenating the major sections and NOT concatenating the minor sections. |
Fine! If you agree, then I will start developing this part so that we can test the effect. |
I certainly agree. I will continue to work on Geometry Nodes setups for all those street elements. |
After years of experiments, the code in the What do you think? |
Yes, the code cleanup is desirable. A folder |
OK. I will start by commenting out unused code, so don't wonder about a series of commits. The functionality should always remain the same. |
The cleaning of StreetGenerator and some files around it is done. Its length has been reduced from 2578 to 585 lines. Since the intersection areas can now be calculated by GNs, I removed the attribute I will now rewrite the method |
Earlier I suggested setting |
So now I will try to use the Bundles and Bundle Intersections with the Geometry Nodes. |
Fine! If you want me to modify the current code to fit your experiments, let me know. The current state of the code is as follows:
|
I couldn't find the iterator |
There was once another idea:
and
but if you are better served by |
I'd prefer |
Implemented and committed. Additionally, the ends of single
EDIT: |
I forgot to mention, that since a while there is a method in the code for finding roundabouts. It is simply based on tests for the tags I don't know if and how you want to get this information in the produced data, to remove parts of the sidewalks in roundabouts. |
I am not that far in the GN-development to care of roundabouts :) |
Maybe I am missing something, but I could not find any |
Sorry, it was me that missed something. I drew these intersections, but didn't put them in the intersection container. Fixed now and committed along with some further development, not active for Karl-Marx-Street. |
Still the same problem. Here is the code I am using to iterate through the connectors: def processIntersection(intersection)
connector = intersection.startConnector
while True:
item = connector.item
process(intersection, item)
connector = connector.succ
if connector is intersection.startConnector:
break |
I don't know where you got for location,intersection in manager.majorIntersections.items():
if intersection.connectsBundles:
for connector in intersection:
print(intersection.id, type(connector.item), connector.item.id)
print(' ')
Output:
1000 <class 'way.item.bundle.Bundle'> 6
1000 <class 'way.item.bundle.Bundle'> 2
1000 <class 'way.item.bundle.Bundle'> 14
1000 <class 'way.item.bundle.Bundle'> 5
1001 <class 'way.item.bundle.Bundle'> 2
1001 <class 'way.item.street.Street'> 215
1001 <class 'way.item.bundle.Bundle'> 12
... The second method looks for streets, that have for street in manager.iterStreets():
if street.pred and isinstance(street.pred,IntConnector):
intersection = street.pred.intersection
if intersection.connectsBundles:
for connector in intersection:
print(street.id,intersection.id, type(connector.item), connector.item.id)
if street.succ and isinstance(street.succ,IntConnector):
intersection = street.succ.intersection
if intersection.connectsBundles:
for connector in intersection:
print(street.id,intersection.id, type(connector.item), connector.item.id)
Output, manually separated by stree
524 1002 <class 'way.item.bundle.Bundle'> 8
524 1002 <class 'way.item.street.Street'> 527
524 1002 <class 'way.item.bundle.Bundle'> 14
524 1002 <class 'way.item.street.Street'> 524
527 1002 <class 'way.item.bundle.Bundle'> 8
527 1002 <class 'way.item.street.Street'> 527
527 1002 <class 'way.item.bundle.Bundle'> 14
527 1002 <class 'way.item.street.Street'> 524
... |
The reason for that issue is clear for me now. At the moment I process only intersection with |
Now fixed. The initial way to construct |
Is it just an occasion that those 4 Bundles were drawn with the same green color? |
Are those inner yellow streets detected as a part of the red horizontal Bundle? |
No, in the final plot, all Bundles are drawn in green, while in the intermediate plot, I used random colors. In the final plot, colors are used to distinguish street classes.
No. They are detected as a combination of two final bundles. See the first image: All green streets are detected at once and must be split into the two final bundles. |
Currently they are set to IntConnectors of "local" Intersections that aren't used anymore after building bundled Intersections. Setting Street.pred and Street.succ to Bundle's IntConnectors will make it possible to determine if a Street is leaving or entering a bundled Intersection. |
Implemented and committed. |
Could you please add an id in the drawings for intersections with Bundles? |
Could you please explain again, when an orange circle is drawn and why is the orange circle at the center of taipei.osm so huge? |
Done and committed. Streets in bundles and intersections with bundles now always get an ID printed. If you want to get all IDs for the scene, add
Orange circles show In contrast, The huge circle you observed was a bug caused by the changes I made to the handling of intersections within a bundle (see my last post). I have commented them out for now until I have a solution. |
The handling of intersections within a bundle has been fixed. Using the committed version, the following scenes containing bundles should (in my opinion) produce consistent results: /facade_visibility/berlin_karl_marx_allee.osm
/streets/rotterdam_01.osm
/streets/taipei.osm
/streets/piestany_north.osm
/streets/prague_vinohrady.osm # Ends wide apart on one side
/streets/berlin_friedrichstrasse.osm
/streets/alsenstrasse.osm
/facade_visibility/manhattan_01.osm In the remaining scenes, I continue to find solutions for handling other problems. |
Let me use an example that is not as clean as those created in Berlin, Karl-Marx-Allee, to illustrate some initial issues to be discussed (from /osm_extracts/facade_visibility/moscow_leningradski_prospekt.osm, slightly rotated):
In green, there is a bundle of way-sections, classified as 'parallel' by the current algorithm (created in the method
createParallelSections
). The ways in green, that are perpendicular to this bundle, do not belong to it, that's just an effect of the random color generator. In my opinion, the selected sections reasonably belong to this bundle.Programmatically, a bundle of ways, classified as 'parallel', is collected as a set of way-sections. The connections between them have to be reconstructed.
Some initial observations:
The text was updated successfully, but these errors were encountered: