a-b-street / osm2lanes

A common library and set of test cases for transforming OSM tags to lane specifications
https://a-b-street.github.io/osm2lanes/
Apache License 2.0
34 stars 2 forks source link

Start a web app to edit lanes and upstream tags to OSM #241

Closed dabreegster closed 2 years ago

dabreegster commented 2 years ago

240

The goal for this app is to make it easier to tag lanes correctly in OSM. Somebody would pick a way, see the current lanes in a cross-section view, drag the cards around and make things look correct, generate OSM tags to represent that, and upload the changeset.

This PR is a minimal prototype of that flow, without uploading changesets yet. I'd like to make sure the basic structure is OK in code review, then send followups to flesh out its functionality more. I'm giving myself an aggressive goal of mid August to make this actually usable end-to-end in simple situations, for the SoTM conference. It's a non-goal right now to handle roads split into multiple ways.

To run it, you should just be able to cd web_editor; ./serve_locally.sh. The only dependency is wasm-pack to compile and python3 to serve a dummy HTTP file server. The demo is not very impressive yet:

https://user-images.githubusercontent.com/1664407/180864376-6f4b2984-8e62-4f5a-a8c4-f5bfa671b7a3.mp4

dabreegster commented 2 years ago

@michaelkirk, I'm starting some vanilla JS + WASM projects. Any interest / time to help review?

github-actions[bot] commented 2 years ago

Benchmark for cb32932

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | tests/224637155 | 6.5±0.03µs | **6.4±0.08µs** | **-1.54%** | | tests/380103730 Japanese Expressway | 8.4±0.14µs | 8.4±0.02µs | 0.00% | | tests/389654080 | 11.3±0.60µs | **10.6±0.16µs** | **-6.19%** | | tests/49207928 cycleway:BACKWARD=lane | **7.8±0.11µs** | 8.0±0.01µs | **+2.56%** | | tests/8591383 a bidirectional cycleway, oneway:bicycle | 8.9±0.01µs | 8.9±0.12µs | 0.00% | | tests/bus:lanes=designated\| | 8.2±0.02µs | **8.1±0.01µs** | **-1.22%** | | tests/busway=lane | 7.4±0.01µs | **7.3±0.01µs** | **-1.35%** | | tests/cycleway=lane | **7.5±0.02µs** | 7.6±0.01µs | **+1.33%** | | tests/cycleway=opposite oneway=yes oneway:bicycle=no | 7.4±0.01µs | **7.2±0.01µs** | **-2.70%** | | tests/cycleway=opposite_track oneway=yes, deprecated | 8.3±0.07µs | 8.3±0.06µs | 0.00% | | tests/sidewalk:right=yes | 6.8±0.11µs | **6.7±0.05µs** | **-1.47%** | | tests/sidewalk=both | **6.9±0.10µs** | 7.0±0.01µs | **+1.45%** |
github-actions[bot] commented 2 years ago

Benchmark for cebbb7c

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | tests/224637155 | 5.3±0.01µs | 5.3±0.01µs | 0.00% | | tests/380103730 Japanese Expressway | 7.0±0.09µs | 7.0±0.07µs | 0.00% | | tests/389654080 | 8.7±0.05µs | 8.7±0.01µs | 0.00% | | tests/49207928 cycleway:BACKWARD=lane | **6.5±0.01µs** | 6.6±0.01µs | **+1.54%** | | tests/8591383 a bidirectional cycleway, oneway:bicycle | 7.2±0.03µs | 7.2±0.07µs | 0.00% | | tests/bus:lanes=designated\| | **6.6±0.04µs** | 6.7±0.03µs | **+1.52%** | | tests/busway=lane | 6.0±0.21µs | 6.0±0.01µs | 0.00% | | tests/cycleway=lane | 6.2±0.02µs | 6.2±0.01µs | 0.00% | | tests/cycleway=opposite oneway=yes oneway:bicycle=no | 5.8±0.02µs | 5.8±0.01µs | 0.00% | | tests/cycleway=opposite_track oneway=yes, deprecated | **6.7±0.12µs** | 6.8±0.01µs | **+1.49%** | | tests/sidewalk:right=yes | 5.5±0.01µs | 5.5±0.07µs | 0.00% | | tests/sidewalk=both | **5.7±0.01µs** | 5.8±0.02µs | **+1.75%** |
dabreegster commented 2 years ago

I guess it would be too hard to somehow plug this into the streetmix source code

From a quick skim through, it wouldn't be easy! But also their UI isn't designed for data entry about existing reality, and their level of detail is way higher than OSM's on street furniture, scooter parking zones, etc. I'm planning to adapt some of their design choices (draggable cards, cross section view, width adjustments, etc)

droogmic commented 2 years ago

I can't do a detailed review, because I am allergic to JS (partial sarcasm).

github-actions[bot] commented 2 years ago

Benchmark for cf34da9

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | tests/224637155 | 6.6±0.27µs | 6.6±0.27µs | 0.00% | | tests/380103730 Japanese Expressway | 8.8±0.36µs | 8.9±0.34µs | +1.14% | | tests/389654080 | 10.8±0.66µs | 10.9±0.42µs | +0.93% | | tests/49207928 cycleway:BACKWARD=lane | 8.1±0.28µs | 8.3±0.46µs | +2.47% | | tests/8591383 a bidirectional cycleway, oneway:bicycle | 9.1±0.38µs | 9.2±0.31µs | +1.10% | | tests/bus:lanes=designated\| | 8.3±0.35µs | 8.3±0.20µs | 0.00% | | tests/busway=lane | 7.6±0.35µs | 7.6±0.34µs | 0.00% | | tests/cycleway=lane | 7.8±0.35µs | 7.8±0.36µs | 0.00% | | tests/cycleway=opposite oneway=yes oneway:bicycle=no | 7.4±0.35µs | 7.4±0.29µs | 0.00% | | tests/cycleway=opposite_track oneway=yes, deprecated | 8.5±0.28µs | 8.4±0.45µs | -1.18% | | tests/sidewalk:right=yes | 6.9±0.39µs | 7.0±0.45µs | +1.45% | | tests/sidewalk=both | 6.9±0.31µs | 7.1±0.27µs | +2.90% |
github-actions[bot] commented 2 years ago

Benchmark for 9649f41

Click to view benchmark | Test | Base | PR | % | |------|--------------|------------------|---| | tests/224637155 | 6.8±0.13µs | **6.6±0.10µs** | **-2.94%** | | tests/380103730 Japanese Expressway | 8.6±0.17µs | 8.6±0.12µs | 0.00% | | tests/389654080 | **10.6±0.12µs** | 10.8±0.09µs | **+1.89%** | | tests/49207928 cycleway:BACKWARD=lane | 8.0±0.08µs | 8.0±0.17µs | 0.00% | | tests/8591383 a bidirectional cycleway, oneway:bicycle | **8.9±0.08µs** | 9.3±0.05µs | **+4.49%** | | tests/bus:lanes=designated\| | **8.2±0.13µs** | 8.4±0.08µs | **+2.44%** | | tests/busway=lane | **7.4±0.12µs** | 7.6±0.04µs | **+2.70%** | | tests/cycleway=lane | 7.6±0.09µs | 7.6±0.16µs | 0.00% | | tests/cycleway=opposite oneway=yes oneway:bicycle=no | 7.2±0.11µs | 7.2±0.14µs | 0.00% | | tests/cycleway=opposite_track oneway=yes, deprecated | 8.5±0.15µs | 8.5±0.14µs | 0.00% | | tests/sidewalk:right=yes | 6.8±0.05µs | 6.8±0.10µs | 0.00% | | tests/sidewalk=both | 7.0±0.08µs | 7.0±0.12µs | 0.00% |
dabreegster commented 2 years ago

Thanks for the reviews! I'll merge this initial prototype in and open more PRs as this takes real shape.