diff --git a/data/presets.yaml b/data/presets.yaml index 4754acec9..f8c4339fd 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -4066,6 +4066,7 @@ en: highway/mini_roundabout: # highway=mini_roundabout name: Mini-Roundabout + # 'terms: traffic circle' terms: '' highway/motorway: # highway=motorway diff --git a/data/presets/presets.json b/data/presets/presets.json index 6667af5eb..a26445e59 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -438,7 +438,7 @@ "highway/give_way": {"icon": "temaki-yield", "fields": ["direction_vertex"], "geometry": ["vertex"], "tags": {"highway": "give_way"}, "terms": ["give way", "yield", "sign"], "name": "Yield Sign"}, "highway/living_street": {"icon": "iD-highway-living-street", "fields": ["name", "oneway", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["cycleway", "maxheight", "covered", "junction_line", "lit", "smoothness", "oneway/bicycle"], "geometry": ["line"], "tags": {"highway": "living_street"}, "name": "Living Street"}, "highway/milestone": {"icon": "temaki-milestone", "geometry": ["point", "vertex"], "fields": ["distance", "direction_vertex"], "tags": {"highway": "milestone"}, "terms": ["milestone", "marker"], "name": "Highway Milestone"}, - "highway/mini_roundabout": {"icon": "maki-circle-stroked", "geometry": ["vertex"], "tags": {"highway": "mini_roundabout"}, "fields": ["direction_clock"], "name": "Mini-Roundabout"}, + "highway/mini_roundabout": {"icon": "maki-circle-stroked", "geometry": ["vertex"], "terms": ["traffic circle"], "tags": {"highway": "mini_roundabout"}, "fields": ["direction_clock"], "name": "Mini-Roundabout"}, "highway/motorway_junction": {"icon": "temaki-junction", "fields": ["ref_highway_junction", "name"], "geometry": ["vertex"], "tags": {"highway": "motorway_junction"}, "terms": ["exit"], "name": "Motorway Junction / Exit"}, "highway/motorway_link": {"icon": "iD-highway-motorway-link", "fields": ["destination_oneway", "destination/ref_oneway", "junction/ref_oneway", "oneway", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["covered", "destination/symbol_oneway", "junction_line", "lit", "maxheight", "maxspeed/advisory", "name", "ref_road_number", "smoothness", "toll"], "geometry": ["line"], "tags": {"highway": "motorway_link"}, "addTags": {"highway": "motorway_link", "oneway": "yes"}, "removeTags": {"highway": "motorway_link", "oneway": "yes"}, "terms": ["exit", "ramp", "road", "street", "on ramp", "off ramp"], "name": "Motorway Link"}, "highway/motorway": {"icon": "iD-highway-motorway", "fields": ["name", "ref_road_number", "oneway_yes", "maxspeed", "lanes", "surface", "structure", "access"], "moreFields": ["toll", "maxheight", "covered", "lit", "smoothness", "minspeed", "junction_line"], "geometry": ["line"], "tags": {"highway": "motorway"}, "terms": ["autobahn", "expressway", "freeway", "highway", "interstate", "parkway", "road", "street", "thruway", "turnpike"], "name": "Motorway"}, diff --git a/data/presets/presets/highway/mini_roundabout.json b/data/presets/presets/highway/mini_roundabout.json index d9d210b12..8cd329f3c 100644 --- a/data/presets/presets/highway/mini_roundabout.json +++ b/data/presets/presets/highway/mini_roundabout.json @@ -3,6 +3,9 @@ "geometry": [ "vertex" ], + "terms": [ + "traffic circle" + ], "tags": { "highway": "mini_roundabout" }, diff --git a/dist/locales/en.json b/dist/locales/en.json index 19736eda0..6a4db5140 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -5646,7 +5646,7 @@ }, "highway/mini_roundabout": { "name": "Mini-Roundabout", - "terms": "" + "terms": "traffic circle" }, "highway/motorway_junction": { "name": "Motorway Junction / Exit", diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index 22a6c9266..d98419bc2 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -65,25 +65,37 @@ export function validationCrossingWays() { return getFeatureTypeForTags(tags); } - - // only validate certain waterway and railway features - var waterways = ['canal', 'ditch', 'drain', 'river', 'stream']; - var railways = ['rail', 'disused', 'tram', 'subway', 'narrow_gauge', 'light_rail', - 'preserved', 'miniature', 'monorail', 'funicular']; - // ignore certain highway and building features - var ignoredHighways = ['rest_area', 'services', 'proposed', 'razed']; - var ignoredBuildings = ['proposed', 'razed']; + // whitelists + var waterways = { + canal: true, ditch: true, drain: true, river: true, stream: true + }; + var railways = { + rail: true, disused: true, tram: true, subway: true, narrow_gauge: true, + light_rail: true, preserved: true, miniature: true, monorail: true, funicular: true + }; + var highways = { + residential: true, service: true, track: true, unclassified: true, footway: true, + path: true, tertiary: true, secondary: true, primary: true, living_street: true, + cycleway: true, trunk: true, steps: true, motorway: true, motorway_link: true, + pedestrian: true, trunk_link: true, primary_link: true, secondary_link: true, + road: true, tertiary_link: true, bridleway: true, raceway: true, corridor: true, + bus_guideway: true + }; + // blacklist + var ignoredBuildings = { + demolished: true, dismantled: true, proposed: true, razed: true + }; function getFeatureTypeForTags(tags) { - if (hasTag(tags, 'building') && ignoredBuildings.indexOf(tags.building) === -1) return 'building'; + if (hasTag(tags, 'building') && !ignoredBuildings[tags.building]) return 'building'; // don't check non-building areas if (hasTag(tags, 'area')) return null; - if (hasTag(tags, 'highway') && ignoredHighways.indexOf(tags.highway) === -1) return 'highway'; - if (hasTag(tags, 'railway') && railways.indexOf(tags.railway) !== -1) return 'railway'; - if (hasTag(tags, 'waterway') && waterways.indexOf(tags.waterway) !== -1) return 'waterway'; + if (hasTag(tags, 'highway') && highways[tags.highway]) return 'highway'; + if (hasTag(tags, 'railway') && railways[tags.railway]) return 'railway'; + if (hasTag(tags, 'waterway') && waterways[tags.waterway]) return 'waterway'; return null; } @@ -139,10 +151,10 @@ export function validationCrossingWays() { // highway values for which we shouldn't recommend connecting to waterways - var highwaysDisallowingFords = [ - 'motorway', 'motorway_link', 'trunk', 'trunk_link', - 'primary', 'primary_link', 'secondary', 'secondary_link' - ]; + var highwaysDisallowingFords = { + motorway: true, motorway_link: true, trunk: true, trunk_link: true, + primary: true, primary_link: true, secondary: true, secondary_link: true + }; var pathHighways = { path: true, footway: true, cycleway: true, bridleway: true, pedestrian: true, steps: true, corridor: true @@ -197,8 +209,8 @@ export function validationCrossingWays() { if (hasTag(entity1.tags, 'tunnel') && hasTag(entity2.tags, 'tunnel')) return null; if (hasTag(entity1.tags, 'bridge') && hasTag(entity2.tags, 'bridge')) return null; - if (highwaysDisallowingFords.indexOf(entity1.tags.highway) !== -1 || - highwaysDisallowingFords.indexOf(entity2.tags.highway) !== -1) { + if (highwaysDisallowingFords[entity1.tags.highway] || + highwaysDisallowingFords[entity2.tags.highway]) { // do not allow fords on major highways return null; }