When boundaries are shared with roads, consider them as roads.

(closes #4973)

This is same as existing logic in the feature matching code
for the "rail" and "past_future" rules.
This commit is contained in:
Bryan Housel
2018-04-09 12:59:13 -04:00
parent 96a7d38e2a
commit c42556ec96
2 changed files with 11 additions and 3 deletions

View File

@@ -138,7 +138,13 @@ export function rendererFeatures(context) {
});
defineFeature('boundaries', function isBoundary(entity) {
return !!entity.tags.boundary;
return (
!!entity.tags.boundary
) && !(
traffic_roads[entity.tags.highway] ||
service_roads[entity.tags.highway] ||
paths[entity.tags.highway]
);
});
defineFeature('water', function isWater(entity) {
@@ -483,7 +489,7 @@ export function rendererFeatures(context) {
var storageDisabled = storage.replace(/;/g, ',').split(',');
storageDisabled.forEach(features.disable);
}
var q = utilStringQs(window.location.hash.substring(1));
if (q.disable_features) {
var hashDisabled = q.disable_features.replace(/;/g, ',').split(',');

View File

@@ -166,6 +166,7 @@ describe('iD.Features', function() {
// Boundaries
iD.Way({id: 'boundary', tags: {boundary: 'administrative'}, version: 1}),
iD.Way({id: 'boundary_road', tags: {boundary: 'administrative', highway: 'primary'}, version: 1}),
// Water
iD.Way({id: 'water', tags: {area: 'yes', natural: 'water'}, version: 1}),
@@ -251,7 +252,7 @@ describe('iD.Features', function() {
'motorway', 'motorway_link', 'trunk', 'trunk_link',
'primary', 'primary_link', 'secondary', 'secondary_link',
'tertiary', 'tertiary_link', 'residential', 'living_street',
'unclassified', 'inner3'
'unclassified', 'boundary_road', 'inner3'
]);
dontMatch([
@@ -340,6 +341,7 @@ describe('iD.Features', function() {
]);
dontMatch([
'boundary_road', // because boundary also used as highway - #4973
'point_bar', 'motorway', 'service', 'path', 'building_yes',
'forest', 'water', 'railway', 'power_line',
'motorway_construction', 'fence'