This follows on from Telefonnummern-QA
Motivation
Phone numbers keep being added to OSM which are not in the agreed format, which includes a country code and excludes most punctuation. This makes it difficult to find actual issues with phone numbers, such as where a number has been transcribed incorrectly in a way that makes it invalid.
I have created the Phone Report website which suggests fixes to phone numbers and identifies invalid phone numbers. This has been in use over recent months to fix many phone numbers. Some of those changes are very simple and similar to each other and could be made automatically.
Making automatic changes in simple cases saves mappersâ time and allows them to spend time on identifying and fixing actually invalid phone numbers.
Proposal
I propose to run an ongoing automated edit on objects with phone, contactËphone, mobile, contactËmobile, phoneËmobile, fax , contactËfax or contactËwhatsapp in Switzerland to reformat phone numbers which have extra punctuation or are missing the country code to international phone format, including the country code and with spaces in the number.
This automated edit has already been discussed and accepted in the US, UK and Canada and is running there.
Edits
Edits will only be made if all of the following applyË
- The value in the phone tag consists of only digits, spaces, parentheses, dashes, hyphens, periods or invisible formatting marks such as non-breaking spaces, zero-width spaces
- The value can be parsed using libphonenumber-js assuming a Swiss country code
- The new number is a valid phone number
- The new number is a Swiss number with +41 country code
- The new number is different by more than just the addition or removal of spaces, for example a country code was added or punctuation was removed.
- The OSM element does not contain any duplicate phone numbers
- The new phone number is not classified as a non-mobile phone number in a mobile tag.
- And only if all of the above applies to every phone tag on the object
This is a subset of the suggested fixes on Phone Report, in particular it excludes any tag with multiple numbers, the duplicate and non-mobile number checks, any numbers with extensions or any with letters.
Number of Objects Affected
Today there are only 3 elements with invalid numbers, as all other invalid numbers have been fixed in the recent months. There seem to be typically 2 or 3 new invalid numbers per day.
Grouping of Edits
Edits would be grouped by canton, with up to one changeset per canton per day.
Examples of edits that would and would not be made
Edits that would be made automatically by the bot
https://www.openstreetmap.org/node/577982928: phone=0564965443 to phone=+41 56 496 54 43
https://www.openstreetmap.org/node/1193865481: phone=0564965655 to phone=+41 56 496 56 55
Edits that are suggested by the website but not made automatically
I donât have any specific examples right now, as everything has been cleaned up. But anything with multiple phone numbers or with text appearing would have suggestions but not get fixed by the bot.
Objects not detected as issues
https://www.openstreetmap.org/node/8488484967: phone=+41793307032
This is not in the target format, but is still valid.
Timescale
I will wait at least 10 days, until 2025-12-26, for any comments before commencing this edit. The proposal will also be shared to be posted in weekly OSM.