-
Notifications
You must be signed in to change notification settings - Fork 2
Web app to edit lanes and upstream changes in OSM #240
Comments
@BudgieInWA had asked by email:
100% agree. I've already hit this problem with the prototype -- if you drag a "new driving lane" card somewhere, we need to auto-set the direction based on its position, and preferably use the locale's default width. Some of this code already exists actually, but in perhaps the "wrong" layer: https://github.com/a-b-street/osm2streets/tree/main/street_network/src/edit. I'm thinking through some options for moving it. The main friction is that A/B Street and |
@BudgieInWA and in response to your other question about using osm2lanes/web_editor/index.html Line 44 in b6f8c0f
|
Cutting osm2streets
Setting up NPM builds of the rust libs (osm2lanes and osm2streets) that get used (from a CDN or bundled directly) is desired I think, but for this goal, I think it should be considered an "internal impl detail" and not be prioritised. If the |
Just a stray thought: the drag-and-drop UI isn't the only choice here, or even the easiest. Most streets follow a template. An example user flow that could make more sense:
Drag and drop could be good for fine-tuning |
I think "click a lane, then pick type (and other properties)" is the most important paradigm for generic editing, such as authoring and correcting OSM data. Treating each lane as an independent entity is a natural and powerful mental model that is not well supported by the raw tags. Shortcuts like "move lane left/right" (aka drag-n-drop) or "add bike lanes left/right/both" seem like awesome conveniences on top, to me. |
What if the lanes you start editing don't even have the right number of lanes? If there's just a button to add a new lane at the end, then you need to be able to drag it to the right position. Or maybe we start simpler and just have a (+add) button in between every existing pair of lanes, to avoid needing drag-and-drop entirely. |
https://www.dflex.dev/ as another possible drag-n-drop JS library |
Adjusting the number of lanes in essential, yes. My instinct would be to first implement
then drag-n-drop can be implemented as an alternative way to trigger the "move left/right" functionality. (It's good to have the buttons for accessibility too) |
I have now started a very minimal prototype in https://github.com/a-b-street/osm2lanes/tree/web_editor to make a new web app that lets people select an OSM way, see the rendered lanes in a cross-section view, edit those lanes (adding, deleting, reordering, modifying width, etc), generate the OSM tags for the changes, and upload to OSM. This is a step towards making it easier to edit lane data in OSM.
@BudgieInWA and I discussed some of the complications that'll come up. Two of the big ones:
When a road is split into multiple parallel ways, what do we do? The lane editor as I'm building it operates on a single way. We could maybe ask the user to draw a line and select all of the ways they want to edit, then present a unified cross section across all of them, and make it very clear which way is getting edited. Of course it won't be that simple, so to start, my goal is just to handle simple cases where one way corresponds to the "entire" road.
The left-to-right order of the draggable lane cards of course depends how the way in OSM is oriented. We need to display the way on the map and make it clear what's happening. Even better, leverage osm2streets + some rendering to draw the lanes on the 2D map at the same time.
I'm building using vanilla JS, which is new to me (this is a learning project!).
When I get something minimally decent open, I'll open a PR -- hopefully a few days if I can keep dodging other responsibilities. :)
The text was updated successfully, but these errors were encountered: