How to use the name-suggestion-index.matcher function in name-suggestion-index

To help you get started, we’ve selected a few name-suggestion-index examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstreetmap / iD / modules / validations / outdated_tags.js View on Github external
export function validationOutdatedTags(context) {
    var type = 'outdated_tags';

    // initialize name-suggestion-index matcher
    var nsiMatcher = matcher();
    nsiMatcher.buildMatchIndex(brands.brands);
    var nsiKeys = ['amenity', 'shop', 'tourism', 'leisure', 'office'];

    var allWD = {};
    var allWP = {};
    Object.keys(brands.brands).forEach(function(kvnd) {
        var brand = brands.brands[kvnd];
        var wd = brand.tags['brand:wikidata'];
        var wp = brand.tags['brand:wikipedia'];
        if (wd) { allWD[wd] = kvnd; }
        if (wp) { allWP[wp] = kvnd; }
    });


    function oldTagIssues(entity, graph) {
        var oldTags = Object.assign({}, entity.tags);  // shallow copy

name-suggestion-index

Canonical common brand names for OpenStreetMap

BSD-3-Clause
Latest version published 4 days ago

Package Health Score

88 / 100
Full package analysis