Skip to content

Commit 6c9c010

Browse files
committed
directly handle access-values of the "emergency" tag, as area-tag exceptions
instead of relying on the presence of dummy presets in the tagging schema see also openstreetmap/id-tagging-schema#1680
1 parent 2d08b97 commit 6c9c010

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

modules/osm/tags.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export function osmSetAreaKeys(value) {
6969
// `highway` and `railway` are typically linear features, but there
7070
// are a few exceptions that should be treated as areas, even in the
7171
// absence of a proper `area=yes` or `areaKeys` tag.. see #4194
72+
// similarly, some tags are both used as a primary key for area features,
73+
// but also as an attribute tag for linear features (e.g. `emergency=yes`)
7274
export var osmAreaKeysExceptions = {
7375
highway: {
7476
elevator: true,
@@ -92,6 +94,14 @@ export var osmAreaKeysExceptions = {
9294
},
9395
amenity: {
9496
bicycle_parking: true
97+
},
98+
emergency: {
99+
yes: false,
100+
no: false,
101+
private: false,
102+
designated: false,
103+
destination: false,
104+
official: false
95105
}
96106
};
97107

@@ -103,6 +113,9 @@ export function osmTagSuggestingArea(tags) {
103113
var returnTags = {};
104114
for (var realKey in tags) {
105115
const key = osmRemoveLifecyclePrefix(realKey);
116+
if (key in osmAreaKeysExceptions && osmAreaKeysExceptions[key][tags[realKey]] === false) {
117+
continue;
118+
}
106119
if (key in osmAreaKeys && !(tags[realKey] in osmAreaKeys[key])) {
107120
returnTags[realKey] = tags[realKey];
108121
return returnTags;

0 commit comments

Comments
 (0)