Git Product home page Git Product logo

name-suggestion-index's Introduction

Build Status npm version

name-suggestion-index

Canonical features for OpenStreetMap

What is it?

The goal of this project is to maintain a canonical list of commonly used features for suggesting consistent spelling and tagging in OpenStreetMap.

Watch the video from our talk at State of the Map US 2019 to learn more about this project!

Browse the index

You can browse the index at https://nsi.guide/ to see which features are missing Wikidata links, or have incomplete Wikipedia pages.

How it's used

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 feature 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.

Name Suggestion Index in use in iD

The name-suggestion-index is in use in iD when adding a new item

Currently used in:

Participate!

We're always looking for help! If you have any questions or want to reach out to a maintainer, ping bhousel on:

Prerequisites

  • Node.js version 10 or newer
  • git for your platform

Installing

  • Clone this project, for example: git clone [email protected]:osmlab/name-suggestion-index.git
  • cd into the project folder,
  • Run npm install to install libraries

About the index

Generated files (do not edit):

The files under dist/* are generated:

  • dist/collected/* - Frequently occuring tags collected from OpenStreetMap
  • dist/filtered/* - Subset of tags that we are keeping or discarding
  • dist/presets/* - Preset files for use in OSM editors, custom JOSM presets, etc.
  • dist/taginfo.json - List of all tags this project uses (see: https://taginfo.openstreetmap.org/)
  • dist/wikidata.json - Cached data retrieved from Wikidata

Input files (edit these):

The files under config/*, data/*, and features/* can be edited:

  • config/*:
    • config/filter_*.json - Regular expressions used to filter the OpenStreetMap tags into keep/discard lists
    • config/match_groups.json - Groups of OpenStreetMap tags that are considered equivalent for purposes of matching
  • data/* - Data files for each kind of feature, organized by topic and OpenStreetMap tag
    • data/brands/amenity/*.json
    • data/brands/shop/*.json
    • data/transit/route/*.json
    • and so on…
  • features/* - GeoJSON files that define custom regions where the features are allowed
    • hawaii.geojson
    • quebec.geojson
    • scotland.geojson
    • and so on…

👉 See CONTRIBUTING.md for info about how to contribute to this index.

Building the index

  • npm run build
    • Processes any custom locations under features/**/*.geojson
    • Regenerates dist/filtered/* keep and discard lists
    • Any new items from the keep list not already present in the index will be merged into it
    • Outputs many warnings to suggest updates to data/**/*.json

Building nsi.guide

https://nsi.guide/ is a web application written in ReactJS that lets anyone browse the index.

  • The source code for this app can be found under app/*
  • npm run appbuild will rebuild it.

Other commands

  • npm run wikidata - Fetch useful data from Wikidata - labels, descriptions, logos, etc.
  • npm run dist - Rebuild and minify the generated files in the dist/ folder.
  • npm run - Lists other available commands

Collecting names from planet

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 osmium commandline tool and node package (may only be available on some environments)
    • apt-get install osmium-tool or brew install osmium-tool or similar
    • npm install --no-save osmium
  • Download the planet
    • curl -L -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,brand,operator,network -o filtered.osm.pbf
  • Run node collect_all.js /path/to/filtered.osm.pbf
    • results will go in dist/collected/*.json
  • A new challenge:
    • Attempt an npm run build. Now that unique id properties are generated, it is possible that this command will fail.
    • This can happen if there are multiple new items that end up with the same id (e.g. "MetroBus" vs "Metrobus")
    • You'll need to just pick one to keep, then keep trying to run npm run build until the duplicate id issues are gone.
    • git add . && git commit -m 'Collected common names from latest planet'

License

name-suggestion-index is available under the 3-Clause BSD License. See the LICENSE.md file for more details.

name-suggestion-index's People

Contributors

bhousel avatar tas50 avatar ent8r avatar sguinetti avatar matkoniecz avatar 1ec5 avatar adamant36 avatar ukchris-osm avatar identitaet avatar doublah avatar bmillemathias avatar kymckay avatar maxerickson avatar mds08011 avatar good-praxis avatar arenal5 avatar robot8a avatar aaronlidman avatar mparrault avatar hanchao avatar tohaklim avatar rickeyrichards avatar matthijsmelissen avatar robinlinde avatar eigenbrot avatar sinclarius avatar andrewharvey avatar masangys avatar xeluna avatar giselle-ms avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.