Automated edits/Standard Dashes
This is the proposal of an automated edit to convert non-standard dashes to standard dashes in Opening Hours tags.
Who
I, matheusgomesms, using my dedicated matheusgomesms-import account. You can contact me through OSM communication channels or Telegram (same username).
What
The proposed mechanical edit aims to convert non-standard dashes found within the opening_hours tag to standard dashes. This includes replacing various types of dashes like en dashes (–) and em dashes (—) with standard dashes (-).
Why
The presence of non-standard dashes in opening hours data can cause parsing errors in various software and applications that rely on OpenStreetMap data, such as Organic Maps. This can lead to inaccurate or missing information about opening hours, causing inconvenience and confusion for users.
Number
As of 18 April 2024, just with – dash (and not other types of dashes), there are 2199 POIs, 7 lines, and 570 polygons (2154 nodes, 564 ways, and 13 relations), using this Overpass query.
How
The proposed process for this mechanical edit involves the following steps:
- Identify affected objects: Use an Overpass Turbo query to retrieve all objects with "opening_hours" tags containing non-standard dashes.
- Export data: Export the identified objects to Level0 editor for further processing.
- Replace dashes: Utilize a Python code to replace all non-standard dashes with standard hyphens within the "opening_hours" data.
- Upload changes: Copy the updated data back to Level0 and upload the corrected data back to OpenStreetMap.
This will be done trying to upload in small sections (e.g., country-wise) to avoid having big bounding boxes.
Discussion
This was heavily discussed in the Community forum. While the proposed method is simple, it can be further improved. The Overpass Turbo query can be refined to encompass a wider range of non-standard dashes. Additionally, exploring more efficient methods for replacing dashes, potentially through scripting or dedicated tools, would enhance the process.
Community feedback and suggestions for improvement are always welcome.
Repetition
This could be done once every 6 months or once a year, assuming that the amount of elements to be fixed will be smaller than the first iteration.
Results
This project was executed a couple of times, and these were the results:
- 18-28 April 2024: 2154 nodes, 564 ways, and 13 relations.
- 2 November 2024: 547 nodes, 142 ways, and 1 relation.