mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-06 19:31:41 +00:00
Improve code for keeping only interesting key/value pairs
Before it was not actually checking that the osmvalue was in the vmap, so we were testing a bunch of pairs like `highway/crossing` and `highway/residential` that would never match a NSI category.
This commit is contained in:
@@ -163,7 +163,7 @@ function loadNsiData() {
|
||||
// and fallbacks like
|
||||
// "amenity/yes"
|
||||
// excluding things like
|
||||
// "highway", "surface", "ref", etc.
|
||||
// "tiger:reviewed", "surface", "ref", etc.
|
||||
//
|
||||
// Arguments
|
||||
// `tags`: `Object` containing the feature's OSM tags
|
||||
@@ -183,12 +183,12 @@ function gatherKVs(tags) {
|
||||
if (!osmvalue) return;
|
||||
|
||||
const vmap = _nsi.kvt.get(osmkey);
|
||||
if (!vmap) return;
|
||||
if (!vmap) return; // not an interesting key
|
||||
|
||||
if (osmvalue !== 'yes') {
|
||||
primary.add(`${osmkey}/${osmvalue}`);
|
||||
} else {
|
||||
alternate.add(`${osmkey}/${osmvalue}`);
|
||||
if (vmap.get(osmvalue)) { // Matched a category in NSI
|
||||
primary.add(`${osmkey}/${osmvalue}`); // interesting key/value
|
||||
} else if (osmvalue === 'yes') {
|
||||
alternate.add(`${osmkey}/${osmvalue}`); // fallback key/yes
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user