diff --git a/data/core.yaml b/data/core.yaml index 72f415511..05aff73ae 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -1298,6 +1298,10 @@ en: title: Lines Tagged as Areas message: '{feature} should be a closed area based on the tag "{tag}"' tip: "Areas must have connected endpoints." + unknown_road: + title: Unknown Roads + message: "{feature} has no classification" + tip: "Roads without a specific type may not appear in maps or routing." fix: connect_almost_junction: annotation: Connected very close features. @@ -1331,6 +1335,8 @@ en: title: Reposition the features select_preset: title: Select a feature type + select_road_type: + title: Select a road type set_as_inner: title: Set as inner set_as_outer: diff --git a/data/presets/categories.json b/data/presets/categories.json index b7ecc20dc..72e385243 100644 --- a/data/presets/categories.json +++ b/data/presets/categories.json @@ -152,8 +152,7 @@ "highway/residential", "highway/living_street", "highway/service", - "highway/track", - "highway/road" + "highway/track" ] }, "category-road_service": { diff --git a/data/presets/categories/road_minor.json b/data/presets/categories/road_minor.json index 5b7d5aeaa..faf55f595 100644 --- a/data/presets/categories/road_minor.json +++ b/data/presets/categories/road_minor.json @@ -6,7 +6,6 @@ "highway/residential", "highway/living_street", "highway/service", - "highway/track", - "highway/road" + "highway/track" ] } diff --git a/dist/locales/en.json b/dist/locales/en.json index 02e04c464..1109fc050 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1598,6 +1598,11 @@ "message": "{feature} should be a closed area based on the tag \"{tag}\"", "tip": "Areas must have connected endpoints." }, + "unknown_road": { + "title": "Unknown Roads", + "message": "{feature} has no classification", + "tip": "Roads without a specific type may not appear in maps or routing." + }, "fix": { "connect_almost_junction": { "annotation": "Connected very close features." @@ -1645,6 +1650,9 @@ "select_preset": { "title": "Select a feature type" }, + "select_road_type": { + "title": "Select a road type" + }, "set_as_inner": { "title": "Set as inner" }, diff --git a/modules/validations/index.js b/modules/validations/index.js index 693107db0..8c5be3e92 100644 --- a/modules/validations/index.js +++ b/modules/validations/index.js @@ -9,3 +9,4 @@ export { validationMissingTag } from './missing_tag'; export { validationOldMultipolygon } from './old_multipolygon'; export { validationOutdatedTags } from './outdated_tags'; export { validationTagSuggestsArea } from './tag_suggests_area'; +export { validationUnknownRoad } from './unknown_road'; diff --git a/modules/validations/unknown_road.js b/modules/validations/unknown_road.js new file mode 100644 index 000000000..c5db4bf66 --- /dev/null +++ b/modules/validations/unknown_road.js @@ -0,0 +1,46 @@ + +import { operationDelete } from '../operations/index'; +import { t } from '../util/locale'; +import { utilDisplayLabel } from '../util'; +import { validationIssue, validationIssueFix } from '../core/validator'; + + +export function validationUnknownRoad() { + var type = 'unknown_road'; + + var validation = function(entity, context) { + + if (entity.type !== 'way' || entity.tags.highway !== 'road') return []; + + return [new validationIssue({ + type: type, + severity: 'warning', + message: t('issues.unknown_road.message', { + feature: utilDisplayLabel(entity, context), + }), + tooltip: t('issues.unknown_road.tip'), + entities: [entity], + fixes: [ + new validationIssueFix({ + icon: 'iD-icon-search', + title: t('issues.fix.select_road_type.title'), + onClick: function() { + context.ui().sidebar.showPresetList(); + } + }), + new validationIssueFix({ + icon: 'iD-operation-delete', + title: t('issues.fix.delete_feature.title'), + onClick: function() { + var id = this.issue.entities[0].id; + operationDelete([id], context)(); + } + }) + ] + })]; + }; + + validation.type = type; + + return validation; +}