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
+2
View File
@@ -53,6 +53,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
* Warn when a way with more than the maximum allowed number of nodes is to be uploaded and provide a way to fix it ([#7381])
* The Suspicious Names validator warning now compares the Name field to the presets name in the users language, not just the raw tag value (typically in British English). ([#9522], thanks [@k-yle])
* Revalidate ways that are connected to the currently edited way to also properly update/catch _disconnected way_s and _impossible oneway_ errors ([#8911], thanks [@andrewpmk])
* Preserve `crossing:markings` tag when fixing missing connection of crossing path and road ([#9586], thanks [@jtracey])
#### :bug: Bugfixes
* Prevent degenerate ways caused by deleting a corner of a triangle ([#10003], thanks [@k-yle])
* Fix briefly disappearing data layer during background layer tile layer switching transition ([#10748])
@@ -74,6 +75,7 @@ _Breaking developer changes, which may affect downstream projects or sites that
[#7381]: https://github.com/openstreetmap/iD/issues/7381
[#8911]: https://github.com/openstreetmap/iD/pull/8911
[#9522]: https://github.com/openstreetmap/iD/issues/9522
[#9586]: https://github.com/openstreetmap/iD/pull/9586
[#9634]: https://github.com/openstreetmap/iD/pull/9634
[#9635]: https://github.com/openstreetmap/iD/pull/9635
[#10003]: https://github.com/openstreetmap/iD/pull/10003
+9 -3
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 {};
}
+10
View File
@@ -292,6 +292,16 @@ describe('iD.validations.crossing_ways', function () {
verifySingleCrossingIssue(validate(), { highway: 'crossing', crossing: 'unmarked' });
});
it('copies over `crossing:markings`', function() {
createWaysWithOneCrossingPoint({ highway: 'residential' }, { highway: 'footway', crossing: 'marked', 'crossing:markings': 'zebra' });
verifySingleCrossingIssue(validate(), { highway: 'crossing', crossing: 'marked', 'crossing:markings': 'zebra' });
});
it('does not copy `crossing` and `crossing:markings` if the `crossing` tag has an unknown value', function() {
createWaysWithOneCrossingPoint({ highway: 'residential' }, { highway: 'footway', crossing: 'zebra', 'crossing:markings': 'zebra' });
verifySingleCrossingIssue(validate(), { highway: 'crossing' });
});
it('flags road=track crossing footway', function() {
createWaysWithOneCrossingPoint({ highway: 'track' }, { highway: 'footway' });
verifySingleCrossingIssue(validate(), {});