Category Property Reference - osmlab/name-suggestion-index GitHub Wiki

Category properties appear at the beginning of each category file.

  "properties": {
    "path": "brands/amenity/bar",
    "skipCollection": true,
    "preserveTags": ["^name"],
    "exclude": {
      "generic": ["^(pool|snack)?\\s?bar$"],
      "named": ["^уют$"]
    }
  },

Category properties:


path

Required yes
Type String
Example "brands/amenity/cafe"

The path for this category in the form "tree/key/value".

Paths must be unique across the name-suggestion-index.


skipCollection

Required no
Type Boolean
Default false

When true, do not merge in new items collected from the OSM planet.

By default, commonly used names are collected from the OpenStreeMap planet and merged into the name-suggestion-index as new items.

(These common names are collected in dist/collected/* and filtered into dist/filtered/* keep and discard lists.)

If skipCollection is true, common names from OSM are not merged into the name-suggestion-index as new items for this category. "skipCollection": true is useful for:

  • categories that are mostly generated via templates from other categories (e.g. amenity/atm, amenity/post_box),
  • categories that are mostly not branded and would generate a lot of noisy items (amenity/college, amenity/university, leisure/playground)

preserveTags

Required no
Type Array[Regex Strings]
Example ["^name"]

For tags matching these regular expressions, values in NSI should not replace an existing value in OSM.

By default, all of the tags as they appear in NSI are how they should appear on an OSM feature. Validator software (such as built into iD) can suggest updates to OSM by comparing an OSM feature's tags against NSI's tags.

In some situations, we want to leave an existing OSM tag value alone. preserveTags contains an Array of regular expressions to match OSM keys where we want to preserve any existing tag value and never suggest a replacement.


👉 The preserveTags property can be set per-category (applying to all items in a category) or per-item.

preserveTags is useful for tags such as "^name" in categories where the name tag is expected to be unique:

  • Cinemas ("AMC Mountainside 10")
  • Hotels ("Embassy Suites Berkeley Heights")
  • Auto Dealerships ("Toyota Autoland Route 22")
  • Charging Stations ("Tesla Supercharger - EUREF Campus")
  • Pubs ("Pitcher & Piano Birmingham")
  • Social Centers ("American Legion Post 304")
  • and others…

preserveTags is also used for the flagpole features - "^flag:name":

  • Because flag:name is expected to be written in the local language and shouldn't be replaced

See also issue #4906


exclude

Required no
Type Object {}

An Object containing regular expressions to match names that should be excluded from this category.

"exclude": {
  "generic": [
    "^(edicola|quiosco|trinkhalle|warung|киоск|мороженое|пресса)$",
    "^kios(co|k|ko|que)?$",
    "^pulper[ií]a$",
    "^taba[ck](os|chi)?( trafi[kc])?$",
    "^trafik(a)?$",
    "^продукт[иы]?$",
    "^მარკეტი( \\(market\\))?"
  ],
  "named": [
    "^(777|bp|esso|exxon|independent|mobil|shell)$"
  ]

These lists are useful for 2 things:

  • names matching "generic" or "named" patterns will not be merged into the name-suggestion-index
  • names matching "generic" patterns will raise a warning in iD to encourage mappers to not use them in the name tag.

See also issue #4924.

exclude.generic

Regular expressions to match generic names to exclude (e.g. 'restaurant', 'burger', 'food court')

  • Generic names are values found commonly used in the name tag, but they are not really names.
  • For these, iD should warn the user "Don't put 'food court' in the name tag".
exclude.named

Regular expressions to match proper names to exclude (e.g. 'Happy Dragon', 'Pizza King', 'Kebabai')

  • Proper names are real names like "Kebabai" that are just common, but not operating as a brand.
  • For these, iD should just let it be. We don't want these in NSI, but we don't want to warn users about it either.
⚠️ **GitHub.com Fallback** ⚠️