This project generates static websites that report on issues in OpenStreetMap (OSM) data, including invalid phone numbers, invalid opening hours and incomplete names. The goal is to identify and provide an easy way to fix incorrect data in OSM.
The generated sites are available at:
- Invalid phone numbers: https://confusedbuffalo.github.io/phone-report/
- Invalid opening hours: https://opening-hours.pages.dev/
- Incomplete names: https://names-report.pages.dev/
The data is usually updated once per day.
The project fetches data from OSM, validates it and generates static HTML reports. The process is as follows:
- Fetch Data: For each country and/or its subdivisions defined in
src/data/constants.js, a planet extract is downloaded and filtered to relevant objects. - Validate Tags: The fetched phone numbers are validated using
libphonenumber-js. Numbers are checked for correct formatting and validity for the specific country. Opening hours are validated usingopening_hours.js. The names are checked to see if the main name tag exists and if it matches one of the multi-lingual names, such asname:en. - Generate Reports: The results are compiled into HTML reports. A main index page lists all countries, each linking to a country-specific page. The country page, in turn, lists reports for its subdivisions. Each subdivision report details the invalid items, providing an option to fix the item directly and upload the edits in a batch as well as direct links to edit the data in various OSM editors (iD, JOSM, etc.).
To add a new country to the report, you need to modify countries.json. Follow these steps:
-
Add a new entry to the countries.json file. You will need to provide:
name: The name of the country.countryCode: The two-letter ISO 3166-1 alpha-2 country code (regional ISO 3166-2 codes can be used on a division level).locale: The locale for formatting and language of the generated pages.pbfUrl: A url for an OSM pbf file for the country- Alternatively this can be on a per division basis (like USA), or mixed (like France).
- bbbike.org and openstreetmap.fr have full metadata, geofabrik.de only has timestamps and geo2day.com has no metadata
divisionsordivisionMap:- Use
divisionsto specify a map of division names to their OSM relation IDs - Use
divisionMapfor a list of divisions and subdivisions (like Germany).
- Use
-
Add translations (optional): If the country uses a language not already present, add a new JSON file in the
locales/directory (e.g.,de-DE.jsonfor German).
Some of the fixes can be made without individual review if they are simply removing punctuation or adding the country code. There is an option of an ongoing automated edit which can be enabled on a country-level basis after discussion with the relevant community.
This wiki page details the process of the bot edit and which elements it would apply to. If you think such an ongoing edit would be useful and accepted in your country then open an issue to suggest it.
Contributions are welcome! If you have suggestions for improvements or find any issues, please feel free to open an issue or submit a pull request.
To run the project locally and generate the reports, follow these steps:
-
Clone the repository:
git clone https://confusedbuffalo.github.io/phone-report/ cd phone-report -
Install dependencies:
npm install
-
Run the build script:
npm start
This will generate the static sites in the
build/directory. -
Run in test mode: To do a quicker, simplified build for testing purposes, run:
BUILD_TYPE=simplified npm start
This will only process one subdivision for one division for one country, which is much faster than a full build, but will still download a full OSM extract for the first country in countries.json.
This project is licensed under the GNU GPL v3.0 or later. See the LICENSE file for details.
Files in the icons/ directory have different licenses, see the README there for more details.
Files in the poly/ directory are sourced from OpenStreetMap data via https://polygons.openstreetmap.fr/ and are licensed under the ODbl