Add code to treat a few special tags as areas instead of lines

even in the absense of a proper `area=yes` or `areaKeys` tag.
(closes #4194)
This commit is contained in:
Bryan Housel
2017-08-06 23:39:58 -04:00
parent 6c880e5ba3
commit 10659505e2
2 changed files with 30 additions and 0 deletions
+20
View File
@@ -152,6 +152,23 @@ _.extend(osmWay.prototype, {
isArea: function() {
// `highway` and `railway` are typically linear features, but there
// are a few exceptions that should be treated as areas, even in the
// absense of a proper `area=yes` or `areaKeys` tag.. see #4194
var lineKeys = {
highway: {
rest_area: true,
services: true
},
railway: {
roundhouse: true,
station: true,
traverser: true,
turntable: true,
wash: true
}
};
if (this.tags.area === 'yes')
return true;
if (!this.isClosed() || this.tags.area === 'no')
@@ -160,6 +177,9 @@ _.extend(osmWay.prototype, {
if (key in areaKeys && !(this.tags[key] in areaKeys[key])) {
return true;
}
if (key in lineKeys && this.tags[key] in lineKeys[key]) {
return true;
}
}
return false;
},