add crossing:markings tag when connecting crossing (#9586)

This commit is contained in:
Justin Tracey
2025-02-17 06:57:25 -05:00
committed by GitHub
parent 294f2b9988
commit d6ee1bb4cd
3 changed files with 21 additions and 3 deletions

View File

@@ -167,6 +167,8 @@ export function validationCrossingWays(context) {
if ((entity1IsPath || entity2IsPath) && entity1IsPath !== entity2IsPath) {
// one feature is a path but not both
if (!bothLines) return {};
var roadFeature = entity1IsPath ? entity2 : entity1;
var pathFeature = entity1IsPath ? entity1 : entity2;
// don't mark path connections with tracks as crossings
@@ -181,11 +183,15 @@ export function validationCrossingWays(context) {
return {};
}
if (['marked', 'unmarked', 'traffic_signals', 'uncontrolled'].indexOf(pathFeature.tags.crossing) !== -1) {
// if the path is a crossing, match the crossing type
return bothLines ? { highway: 'crossing', crossing: pathFeature.tags.crossing } : {};
// if the path is a crossing, match the crossing type and markings
var tags = { highway: 'crossing', crossing: pathFeature.tags.crossing };
if ('crossing:markings' in pathFeature.tags) {
tags['crossing:markings'] = pathFeature.tags['crossing:markings'];
}
return tags;
}
// don't add a `crossing` subtag to ambiguous crossings
return bothLines ? { highway: 'crossing' } : {};
return { highway: 'crossing' };
}
return {};
}