Canonical common brand names for OpenStreetMap
The goal of this project is to maintain a canonical list of commonly used names for suggesting consistent spelling and tagging of features in OpenStreetMap.
When mappers create features in OpenStreetMap, they are not always consistent about how they
name and tag things. For example, we may prefer McDonald's tagged as amenity=fast_food
but we see many examples of other spellings (Mc Donald's, McDonalds, McDonald’s) and
taggings (amenity=restaurant).
Building a canonical name index allows two very useful things:
- We can suggest the most "correct" way to tag things as users create them while editing.
- We can scan the OSM data for "incorrect" features and produce lists for review and cleanup.
The name-suggestion-index is in use in iD when adding a new item
Currently used in:
- iD (see above)
- Vespucci
- JOSM presets available
- Clone this project, for example:
git clone git@github.com:osmlab/name-suggestion-index.git cdinto the project folder,- Run
npm installto install libraries
Preset files (used by OSM editors):
dist/name-suggestions.json- Name suggestion presetsdist/name-suggestions.min.json- Name suggestion presets, minifieddist/name-suggestions.presets.xml- Name suggestion presets, as JOSM-style preset XML
Name lists:
dist/allNames.json- all the frequent names and tags collected from OpenStreetMapdist/discardNames.json- discarded subset of allNamesdist/keepNames.json- kept subset of allNames
config/filters.json- Regular expressions used to filterallNamesintokeepNames/discardNamesconfig/canonical.json- The main config file containing all the most correct names and tags to assign to them
👉 See CONTRIBUTING.md for info about how to contribute to this index.
npm run build- Regenerates
dist/keepNames.jsonanddist/discardNames.json - Any new
keepNamesnot already present inconfig/canonical.jsonwill be added to it - Outputs warnings to suggest updates to
config/canonical.json
- Regenerates
This takes a long time and a lot of disk space. It can be done occasionally by project maintainers. You do not need to do these steps in order to contribute to the index.
- Install
osmiumcommandline toolapt-get install osmium-toolorbrew install osmium-toolor similar
- Download the planet
curl -o planet-latest.osm.pbf https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
- Prefilter the planet file to only include named items with keys we are looking for:
osmium tags-filter planet-latest.osm.pbf -R name -o named.osm.pbfosmium tags-filter named.osm.pbf -R amenity,shop,leisure,man_made,tourism -o wanted.osm.pbf
- Run
node build_allNames wanted.osm.pbf- results will go in
dist/allNames.json git add dist/allNames.json && git commit -m 'Updated dist/allNames.json'
- results will go in
name-suggestion-index is available under the 3-Clause BSD License. See the LICENSE.md file for more details.
