Skip to content
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

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

k-yle
Copy link
Collaborator

@k-yle k-yle commented Nov 2, 2024

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.

@k-yle k-yle added the validation An issue with the validation or Q/A code label Nov 2, 2024
entities[0].tags.footway === 'sidewalk' ||
entities[1].tags.footway === 'sidewalk' ||
entities[0].tags.cycleway === 'sidewalk' ||
entities[1].tags.cycleway === 'sidewalk'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part needs more discussion, currently it only applies to footway=sidewalk and cycleway=sidewalk.

I think it would make sense to apply this autofix to any highway=X where X=crossing is a valid tag. This means it would apply to footway, cycleway, bridleway, and path

* @param {[string, string][]} edges
* @param {Tags} connectionTags
*/
function actionConnectCrossingWays(loc, edges, connectionTags) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function is not new, if you click hide whitespace changes, then the github UI understands that this function was simply deindented & moved 20 lines up.

@tordans
Copy link
Collaborator

tordans commented Nov 2, 2024

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

@k-yle
Copy link
Collaborator Author

k-yle commented Nov 3, 2024

facebook/Rapid#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

@forteller
Copy link

As the creator of the original issue I just have to say thank you so much for doing this! <3 I hope it can be merged soon :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validation An issue with the validation or Q/A code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support automatically creating pedestrian crossing when sidewalk crosses roads
3 participants