Display lane tagging #82
Replies: 18 comments
-
Hey! Thank you! A/B Street is a really great project! I'm used to checking it out from time to time. It's exciting how much information we can get from OSM! For now, I use just road class to determine its width. And I was thinking of using Since the final goal of the project is to show all the richness of the OpenStreetMap data, I'd be happy to be able to visualize all information about lanes, signs, road markings, and pedestrian crossings. Any help on this would be just great! I have some experience in creating transit maps, so maybe I can use some ideas from that as well. Thanks for your interest! I'm looking forward to cooperating! |
Beta Was this translation helpful? Give feedback.
-
Unfortunately the
What I can offer for the moment is https://github.com/a-b-street/abstreet/blob/master/map_model/src/make/initial/lane_specs.rs. This is lots of code, but the overview is simple. It takes the key/values for a way, and generates a list of There are tests at https://github.com/a-b-street/abstreet/blob/e4a95b604e36d3c24394c1c8afd726202e924374/map_model/src/make/initial/lane_specs.rs#L355 that capture some of the behavior. I've thought about encoding the test cases in some easy-to-parse format and popularizing them within the OSM community. It'd be great if different software could agree about the interpretation of them. The code I have so far gets lots of things wrong, and my hope is that there's a way to let people with much more OSM tagging expertise than me write up test cases, even if they don't want to dive into programming. If you want, I could extract parts of this code so that you could call it easily. This could either be a library that you link against from Python, or a command-line tool that you call. The output could be these
This is unrelated to this issue, but a general question: do you think it's feasible to transform a road network from OSM into a transit map automatically? Distorting distances, curves in the road, and angles would all be fine, as long as the result is topologically equivalent to the original. I've been curious about this problem for a while, because it could be a nice way to avoid rendering headaches with intersections having roads join at every possible angle. |
Beta Was this translation helpful? Give feedback.
-
You’re right about problems with tagging. I faced it when tried to tag roads with some JOSM visualizer for lanes. I agree, that it's important to highlight errors instead of hiding or somehow trying to fix them.
Thank you! I feel like connecting two and more roads is the more challenging task and I want to start with it and add other lane information later. Some first sketches: I didn’t still choose the license for the code. How do you think, which one should I choose? I'm considering MIT and Apache 2. |
Beta Was this translation helpful? Give feedback.
-
Do you mean something like bus network maps? I've been working on underground transit maps. It's more a graph visualization task, but I think, it's quite similar. Of course there are many parts of the process that can be automated, but I believe, if we want to do the whole thing fully automatically and meet some complex aesthetic criteria, we have to use some kind of ML algorithms. |
Beta Was this translation helpful? Give feedback.
-
Agreed. In case it's helpful, https://wwwtyro.net/2019/11/18/instanced-lines.html has a good geometric explanation of how different thick line joins work. Calculating the polygon representing the junction can be a hard problem, but your sketches look great so far. I have some notes about what I've tried here and here. Does the algorithm in your sketch pick a fixed distance to "trim back" the intersection from the road? Or are you first widening both road segments, then taking the overlap? I've tried variations of the latter approach, but hit issues with 3-way "T" intersections, IIRC.
I'm not knowledgeable about licenses; I think MIT is similar to Apache, except just much simpler to read?
Maybe. I mean simplified maps where the lines tend to meet at 90 or 45 degree angles. Distances and exact position are distorted, but the graph structure is easier to understand. I think I've tried putting a road network from OSM into graphviz and trying different algorithms there to lay out the graph, but the result didn't work. Using ML to minimize some aesthetic cost function makes sense. I was just curious if you had thought about this problem much. |
Beta Was this translation helpful? Give feedback.
-
First step. Pretty naïve support of road width based on lane number: |
Beta Was this translation helpful? Give feedback.
-
Yes, I was trying to compute the overlap. Now I think, it's the most challenging task. Especially when there are many roads in an intersection. It should be a lot of fun!
Thank you and sorry for the unrelated question. MIT it is then.
I've tried to generate some maps like this. But from Wikidata, not OpenStreetMap. It's pretty technical task if you have manualy selected node positions or just specify directions for the lines and use predefined space between nodes. For example, I can create maps like this (it's for trams but nevertheless I use underground map style): But when I try to automatically arrange nodes using their geo positions, and, more important, try to assume best label position automatically, the task became too complex. |
Beta Was this translation helpful? Give feedback.
-
Simple implementation of intersection drawing: |
Beta Was this translation helpful? Give feedback.
-
Looking like solid progress! Just stumbled across http://blog.imagico.de/navigating-the-maze-part-2/, with more ideas about rendering lane detail |
Beta Was this translation helpful? Give feedback.
-
Oh, wow! Yeah, I thought about something like this. But this is way more complicated than I imagined. Now I have just simple lanes and one color: |
Beta Was this translation helpful? Give feedback.
-
Whoa, this is looking really nice. I think this approach is simpler than A/B Street's -- I try to maintain the invariant that each lane hits the intersection polygon at 90 degrees. Vehicles use that as the stopping line. But this example in reality looks closer to your rendering; the stop line probably is still perpendicular to each lane, but the position may be different for each lane on one segment. |
Beta Was this translation helpful? Give feedback.
-
Well, I have to admit, that I'm stuck. Have no idea what to do with acute and almost straight angles. |
Beta Was this translation helpful? Give feedback.
-
Do you mean something like: I actually special-case intersections between only two road segments, just picking some hardcoded value to trim each road center-line back from the common point, and making a fixed quadrilateral shape. More generally my approach is described at https://docs.google.com/presentation/d/1cF7qFtjAzkXL_r62CjxBvgQnLvuQ9I2WTE2iX_5tMCY/edit#slide=id.g6201f22714_0_16. I really need to write up a full article about this problem, since it's so interesting and has so many edge cases. The quick visual summary is calculating the left and right side of each thickened road: This results in bigger intersection polygons than your approach, since it forces roads to hit the polygon at right angles. That's not realistic sometimes. And there are still problems sometimes, like the lower left corner: |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly like that! Even when there are more than two roads intersect.
Yeah, I've added some obvious hacks for these cases but still don't like the results.
It seems like I use exactly the same approach. Thank you for the descriptions. It's very helpful. I have some more ideas to try. |
Beta Was this translation helpful? Give feedback.
-
Hey, @dabreegster! I was working on tile generation and recently returned to this issue. I've added lane drawing based on @imagico work and planning to add lane delimiters, special lane drawing, and sidewalks. Do you think it is the right direction of developement? This issue seems to be too big. Is it OK if I convert this issue into a discussion? I've created a project and will create separate issue like #81. |
Beta Was this translation helpful? Give feedback.
-
Yes, this looks fantastic! I forgot some context on your approach so far -- are you using Also, I finally wrote the huge deep-dive into A/B Street's intersection geometry: https://a-b-street.github.io/docs/tech/map/geometry/index.html. I hope it provides inspiration / reference to your work here! |
Beta Was this translation helpful? Give feedback.
-
Oh yes, feel free! I'm a big fan of Github discussions for these more open-ended brainstorms. |
Beta Was this translation helpful? Give feedback.
-
Thank you! For now, to determine road width I use the Wow! Thank you for the article. It's really comprehensive! I got answers to questions that I didn't know about yet. |
Beta Was this translation helpful? Give feedback.
-
Hello, this is a really exciting project to see! I'm curious if you're thinking of showing details along roads, such as number of lanes, dedicated cycle/transit space, parking, turn lanes, and such. If so, I may be able to help a bit -- I work on A/B Street and have been struggling for a while to render OSM roads in high detail. A quick demo:
Possible ways to collaborate:
Thanks, and keep up the awesome work with this renderer!
Beta Was this translation helpful? Give feedback.
All reactions