-
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
Workflow and data structure for streets #72
Comments
(1) Street sections are grouped into roadways. A street may have one, two or more roadways. If a street contains two or more roadways, then they are grouped into a cluster. The class The class |
(2) |
(3) @setup
street {
numLanes: random_weighted( (2, 70), (4, 30) );
numLanesOneway: random_weighted( (1, 75), (2, 25) );
} Those style blocks with the |
(4) |
(5) An OSM node representing a crosswalk is tagged with An OSM node with a crosswalk may be in the cropped part. In that case case the index of the node with the crosswalk will be 0 or N-1, where N is the number of nodes in the cropped centerline. |
Intersection areas do not yet exist at this stage. Perhaps, the positions of the intersection nodes (currently of Besides neighbor sections, intersections and dead-ends, instances of a
I am not sure if I understand this correctly. Does the
This will work fine for linear cases, like those with the |
I still do not understand this idea. The only case I know of where the number of lanes is not specified in OSM is when there is no EDITED: |
How about using an empty
Linked lists allow inserting and removing items easily. So a
A class The class It would be highly desirable to do clustering before assigning a PML style to an instance of the class
Do you mean something like on the image below? The intersections at the start and at the end of an instance of the class |
Yes, that table should be moved to PML. Using the function |
The tag
Let's consider the following intersection: Suppose that the OSM way on the right starts in the center of the intersection. A node with the sidewalk marked with the red color has the index |
You are right, I did a mismatch in my overpass turbo query. We will need a new method in the
It will be easy to derive this number from the trim parameter of the way-section's polyline. |
Yes, this will be the solution.
I assume you mean a linear, doubly linked list. But that requires that the position of all these objects ( | -------- Section --------| => | ---- Section ----| --PtStop--| ---- Section ----|
In principle, the complete 2D topology has to be known before PML styles get assigned. This is possible, I think, but it is a major redesign.
Yes. You wrote:
On the right side of the drawing, there are two |
Yes.
I don't consider splitting of sections as a risk. I consider splitting as an integral part of the workflow, since it's required to split the related |
I am somewhat reluctant to use this seemingly simple solution of mapping all routes with linked lists. Let me try to explain my reasons. The simple splitting of sections (list nodes) within a doubly-linked list is quite simple and well known. A problem arises when it is necessary to find all these sections at once. This is the case when they have to be inserted into a spatial index (for performance reasons). Then you have to search all of them along many linked lists, insert them into the index, and somehow provide a reference to find them backwards, when some of them are given as a result of an index operation (for example, find all neighbors of one of them). If any changes have to be made due to such an operation, the change is not only in the linked list, but also in the reference index. Of course this is possible, but it is quite complicated and prone to errors. There are several tasks in the whole process, for instance building clusters or merging intersecting areas, where such situations occur. As I said, I had some concerns and therefore did not choose such approaches in my previous solution. But let's give it a try. |
What are the alternatives? Perhaps there is a way to combine two approaches. |
You have studied what it takes to use PML in a meaningful way. This way, I get very concrete requirements for the processes in StreetGenerator, and we establish a more detailed cooperation. Even though it means resetting and redesigning much of the development that has already been done, I like this situation. So let us try to find a solution. Many of the previous ideas can be reused, perhaps in a slightly different form. I am wondering: Should we start a new branch so that the previous code is preserved even if it is no longer used? I already stored a lot of functions in the code that do not currently have any use. |
I created the tag |
I would like to take a closer look at the "bundle" concept. When we used clusters, these were constructed more or less together as cluster-way and cluster-intersection. Here are two examples of such cluster intersections, on the left the simple one (East of Karl-Marx-Allee scene) and on the right a more complicated one with four way section ends, two of which go underground (Moscow scene). Intersection areas can only be calculated if the width of all way-sections is known, which is not yet the case when My suggestion now is that I try to find the intersections that belong to these endpoints and define their center of gravity as the provisional node of a still incomplete intersection (red in the right image). Each of its connectors could then be a list of instances of the But what to do with the sections marked by green lines? When we were working with clusters, in most cases they had to be deleted at the time when the area was constructed. But I'm not sure whether it would be safe to remove them before the |
What if the largest possible roadway width is used to detect a cluster of roadways? |
I am currently investigating structures that can be used locally in The first ones arise from the question we have already begun to discuss in issue #66. We need to define directions for the linear structures proposed in this thread, they should have a source (src) vertex and a destination (dst) vertex. Instances of the class The question is, how shall we define the directions of the higher-level structures ( If we were to use the x- and y-coordinate rules, the start coordinates of the |
At the call to self.isOneWay = False # True if one-way road.
self.totalLanes = None # Total number of lanes, includes bothLanes
self.forwardLanes = None # Number of forward lanes
self.backwardLanes = None # Number of backward lanes
self.bothLanes = None # Number of lanes that allow a turn available in both directions (tag lanes:both_ways) |
I already often flirted with using the library networkx for various network tasks in the blosm addon. But I didn't know how to install the library inside Blender, since pip install is not possible. But now, I found an article here, showing how easy it can be. In principle, it is sufficient to import a specific folder with pure Python code, similar as we did with ANTLR4 for PML, for example. I tested it and it works fine. So I decided to base the refactoring of the |
It's not required. |
I see the packages Installing external packages for Blender's Python can be very tricky taking into account a broad user base of the addon. |
At the moment I can't propose for bundles anything else besides the XY-coordinates rule. The details of the calculation can be hidden in a method |
It would be good to describe it briefly how to get this version.
I suggesting adding the definition of a way-map to our section Definitions. |
The version of blosm_networkx in the lib folder of the blosm addon is based on the latest release 3.2.1 of NetworkX downloaded from its GitHub repository on 12/16/2023. Only the code in its folder networkx is used. Blender does not support the scipy and pandas packages, which are part of the NetworkX requirements. Therefore, we have reduced our version (blosm_networkx) by removing all files in it, that use functions from these packages or derivatives of methods that use them. In detail, we did:
|
The way-map, as I intend to use it, does not fit into these (by the way very old) definitions. It is just a tool of mine to keep all objects in a single structure. It has two main purposes. First, it should be a factory for any linked lists you want to have. Second, it should allow me to perform operations, such as splitting ways, without needing to find the same object in multiple structures. It should be a solution to the problem mentioned here. At present, its functionality is still rather unclear and experimental. What about the new definitions |
I suggest moving modules from way/waymap/nodes and way/waymap/section to way/items like it's done for buildings. |
I like them. At the moment I am not sure if the item |
Done. |
If you ever get some time: I could use a manager to find the nodes for crosswalks and public transport stops from the OSM data. I think this can't be done using the |
The existing class
How will the attributes
How about calling them
A
A
I thought
Yes.
A
The |
I had some trouble with the language. Unlike nodes, which are local objects,
They will be instances of
I wanted to avoid that, because
You say "can split", and, in #76 (comment), "The related
I will need a recipe on how a Roadway (and a
We never had a |
A pt-stop is also a line object, it may have a noticeable length. It's another reason why I proposed to move all of them to the directory
Ok, let's use the names
A
The construction of Roadways can skipped for now. I suggest considering ambiguous cases for the constructions of Bundles.
An example of a possible class |
The code to detect and process crosswalks and pt-stops must be developed. I suggesting discussing that in #73 and #76. |
Nevertheless, the class still can be named as |
I made an approach to tune the algorithm, that finds groups of parallel ways, but now for the complete set of ways, that is the way-sections returned by the Maybe I should change the term parallel to equidistant, because the way-sections can also be curved (same scene and osm_extracts/facade_visibility/bratislava_old_town.osm): Although equidistant is only true for any two ways in the group, while other ways may have a different, but still constant, distance. For example, I like the result on osm_extracts/facade_visibility/moscow_leningradski_prospekt.osm, where sometimes up to 9 objects were correctly grouped along the Leningradski Prospekt: But I also found a problem that needs to be solved somehow. Paths that form a corner must normally be excluded from the equidistant group. However, if we split them at the corner and introduce e.g. a Such effects are usually to be expected for cycleways and footways. The example on the left is from osm_extracts/streets/milano_01.osm, the footways around the Via Carlo Gomes, while the example at the right is from osm_extracts/streets/piestany_north.osm, also footways along the Díčova. |
A great result! How to reproduce it? |
I have committed a version that plots the result of this algorithm, when executed in script mode. The plotting code is at the end of the generate_streets.py module, and the output to the figure starts at line 651 of this module. If (at the same line) the variable BTW: Is there any way to tell if the code is running in script mode or as an addon in Blender? This would be useful when using |
What are the parameters in the command line to reproduce the results? |
|
I've just added the attribute type to the classes derived from The following expressions can be used the methods of the class if self.app.type == AppType.commandLine:
... |
Thanks! |
Ok. Then the next step is to combine it with the generation of intersection clusters. |
Class
|
Also the attribute |
The boolean attribute |
No description provided.
The text was updated successfully, but these errors were encountered: