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 South Africa 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, Canada, Switzerland and Austria and is running there on the confusedbuffalo-bot account.
Edits
Edits will only be made if all of the following applyË
-
The value in the phone tag consists of only digits, spaces, brackets, hyphens, dashes, full stops or invisible formatting marks such as non-breaking spaces and zero-width spaces
-
The value can be parsed using libphonenumber-js assuming a South African country code
-
The new number is a valid phone number
-
The new number is a South African number with +27 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
As of today, there are 50 elements that would be edited, as many have been previously fixed. There seem to be typically a few new invalid numbers each week (I have not been doing fixes in South Africa for a while to see the rate of new cases, so check the progress page to see what has happened).
Grouping of Edits
Edits would be grouped by province, with up to one changeset per province per day.
Examples of edits that would and would not be made
Edits that would be made automatically by the bot
n13580146701 phone=0835382865 to phone=+27 83 538 2865
n13353420623 phone=+27 011 674 2608 to phone=27 11 674 2608
n13452280701 phone=+27 (11) 804-1730 to phone=+27 11 804 1730
Edits that are suggested by the website but not made automatically
I donât have any specific examples right now, as all of the simple cases have been cleaned up. But the main one would be anything with multiple phone numbers or text that has inadvertently been included.
Objects not detected as issues
n12997560465: phone=+27721800544
This is not in the target format, but is still valid.
Timescale
I will wait at least 2 weeks, until 2026-03-11, for any comments before commencing this edit.