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

Offer to connect sidewalk to service road without tagging crossing #9650

Merged
merged 2 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1931,6 +1931,8 @@ en:
title: Connect this feature
connect_features:
title: Connect the features
connect_using_crossing:
title: Connect using a crossing
connect_using_ford:
title: Connect using a ford
continue_from_start:
Expand Down
29 changes: 22 additions & 7 deletions modules/validations/crossing_ways.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ export function validationCrossingWays(context) {
motorway: true, motorway_link: true, trunk: true, trunk_link: true,
primary: true, primary_link: true, secondary: true, secondary_link: true
};
var nonCrossingHighways = { track: true };

function tagsForConnectionNodeIfAllowed(entity1, entity2, graph) {
function tagsForConnectionNodeIfAllowed(entity1, entity2, graph, lessLikelyTags) {
var featureType1 = getFeatureType(entity1, graph);
var featureType2 = getFeatureType(entity2, graph);

Expand All @@ -141,11 +140,18 @@ export function validationCrossingWays(context) {
// one feature is a path but not both

var roadFeature = entity1IsPath ? entity2 : entity1;
if (nonCrossingHighways[roadFeature.tags.highway]) {
// don't mark path connections with certain roads as crossings
var pathFeature = entity1IsPath ? entity1 : entity2;
// don't mark path connections with tracks as crossings
if (roadFeature.tags.highway === 'track') {
return {};
}
// a sidewalk crossing a driveway is unremarkable and unlikely to be interrupted by the driveway
// a sidewalk crossing another kind of service road may be similarly unremarkable
if (!lessLikelyTags &&
roadFeature.tags.highway === 'service' &&
pathFeature.tags.highway === 'footway' && pathFeature.tags.footway === 'sidewalk') {
return {};
}
var pathFeature = entity1IsPath ? entity1 : entity2;
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 } : {};
Expand Down Expand Up @@ -435,6 +441,10 @@ export function validationCrossingWays(context) {

if (connectionTags) {
fixes.push(makeConnectWaysFix(this.data.connectionTags));
let lessLikelyConnectionTags = tagsForConnectionNodeIfAllowed(entities[0], entities[1], graph, true);
if (lessLikelyConnectionTags && JSON.stringify(connectionTags) !== JSON.stringify(lessLikelyConnectionTags)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When a footway crosses a major road, it would be possible to offer a crossing=no connection as a less likely option. However, crossing=no doesn’t have a preset yet (openstreetmap/id-tagging-schema#548) and looks just like highway=crossing on the map, which could be confusing.

Copy link
Member

@tyrasd tyrasd May 25, 2023

Choose a reason for hiding this comment

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

offer a crossing=no connection

I agree that the tagging-schema would need to support this first in order to make sense. Let's keep that option in mind for a later stage.

fixes.push(makeConnectWaysFix(lessLikelyConnectionTags));
}
}

if (isCrossingIndoors) {
Expand Down Expand Up @@ -692,16 +702,21 @@ export function validationCrossingWays(context) {
function makeConnectWaysFix(connectionTags) {

var fixTitleID = 'connect_features';
var fixIcon = 'iD-icon-crossing';
if (connectionTags.highway === 'crossing') {
fixTitleID = 'connect_using_crossing';
fixIcon = 'temaki-pedestrian';
}
if (connectionTags.ford) {
fixTitleID = 'connect_using_ford';
fixIcon = 'temaki-pedestrian';
}

return new validationIssueFix({
icon: 'iD-icon-crossing',
icon: fixIcon,
title: t.append('issues.fix.' + fixTitleID + '.title'),
onClick: function(context) {
var loc = this.issue.loc;
var connectionTags = this.issue.data.connectionTags;
var edges = this.issue.data.edges;

context.perform(
Expand Down