openstreetmap / iD

🆔 The easy-to-use OpenStreetMap editor in JavaScript.
https://www.openstreetmap.org/edit?editor=id
ISC License
3.38k stars 1.21k forks source link

automatically create pedestrian crossing line when joining sidewalk/road #10524

Open k-yle opened 2 weeks ago

k-yle commented 2 weeks ago

Closes #7385

When a sidewalk crosses a road, the validator already adds a crossing node, but it does not split the sidewalk line.

This PR makes the validator automatically split the sidewalk and create a crossing line.

image

after clicking Connect using a crossing: image

Most of the code is re-used from the Connect using a bridge/tunnel action. This means the length of the automatically-generated crossing also uses the existing code.

tordans commented 2 weeks ago

@k-yle This looks great. JFYI there are things happening at https://github.com/facebook/Rapid/pull/1583 and https://github.com/facebook/Rapid/pull/1599 which are related to crossings but I did not look into it more, yet.

k-yle commented 2 weeks ago

https://github.com/facebook/Rapid/pull/1583 seems pretty cool, if it were backported to iD, then we should probably auto-create the kerb nodes, otherwise every new crossing will immediately cause a validator warning