Re: [Tagging] phone validity - phone "preset"

2017-09-06 Thread Mark Wagner

It would help even more if the editors understood local phone number
formats, and could automatically turn (202)-456-1414 or 041 58 460 55
11 into the appropriate international format.

-- 
Mark

On Tue, 5 Sep 2017 19:01:44 +
Lukas Sommer  wrote:

> It would likely yet help a lot if th editors would simply check if
> 
> - the number does not start with “+”
> - the number (after the starting “+” sign) contains other characters
> then digits, spaces (and maybe dashes).
> 
> This is quite simple and could nevertheless catch yet a lot of issues…
> 
> 2017-09-05 16:51 GMT, marc marc :
> > Hello,
> >
> > on the french-speaking mailing, a contributor noticed a high rate
> > of incorrect value for the tag "phone". the most common error is
> > using the national format number instead of the international
> > format.
> >
> > A monthly project 'll maybe fix some of those errors.
> > Some quality tool can help those fix.
> >
> > But the best would be to avoid the mistake when a user fill
> > in the data in iD, josm or whatever.
> >
> > Is anyone aware of a kind of "preset" that can be used for phone ?
> > Otherwise it would be useful to create with local communities a wiki
> > page containing a list of valid prefixes example + 322xxx is
> > valid, +331 also but 01 is not valid in France.
> > Or using something like
> > https://github.com/googlei18n/libphonenumber/
> > https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#where-do-we-get-information-from-to-determine-if-a-number-range-is-valid
> >
> > Would it also be useful to put a corrective suggestion?
> > for example 01 #+331
> >
> > Of course, I am not talking about the exact form of the list,
> > nor the fact that some countries will have a list,
> > while others not.
> > nor the difficulty when a poi has several corresponding numbers
> > attached several countries.
> > I 'm talking about the general guideline.
> >
> > The aim is not to forbid some values but to allow
> > common editor to guide the user to avoid a very common error.
> > ___
> > Tagging mailing list
> > Tagging@openstreetmap.org
> > https://lists.openstreetmap.org/listinfo/tagging
> >  
> 
> 


___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging


Re: [Tagging] phone validity - phone "preset"

2017-09-06 Thread Tom Pfeifer

On 06.09.2017 06:56, André Pirard wrote:


I'll suggest this to JOSM and they'll probably do it. They're the best.


Found your ticket opened here:
https://josm.openstreetmap.de/ticket/15250

Looking into iD, I browsed the tickets for 'phone',
https://github.com/openstreetmap/iD/search?p=1=phone=Issues
they seem to have some national templates, but a strict compliance check was 
rejected here:
https://github.com/openstreetmap/iD/issues/2704

Maybe an iD user could check the current behaviour.

tom


___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging


Re: [Tagging] phone validity - phone "preset"

2017-09-05 Thread André Pirard
On 2017-09-05 21:01, Lukas Sommer wrote:
> It would likely yet help a lot if th editors would simply check if
>
> - the number does not start with “+”
> - the number (after the starting “+” sign) contains other characters
> then digits, spaces (and maybe dashes).
>
> This is quite simple and could nevertheless catch yet a lot of issues…
Yes it is not too complicated.
Typing this at Ubuntu or any Linux command line does what you say:

$ read -p 'Phone number: ' number; [[ $number =~ ^[+][0-9\ \-]*$ ]] &&
echo GOOD
Phone number: 866 356 8207
Phone number: +1 866-356-8207
GOOD

It can be included in a program and easily improved to enforce a
separated country code, maximum of digits, etc.

I'll suggest this to JOSM and they'll probably do it. They're the best.

Use JOSM.  JOSM is the best.

Using Ubuntu/Linux is fun.  One can even use it without leaving Windows:
Install VirtualBox and use it to install Linux.  Ubuntu MATE recommended.

Cheers

André.


> 2017-09-05 16:51 GMT, marc marc :
>> Hello,
>>
>> on the french-speaking mailing, a contributor noticed a high rate
>> of incorrect value for the tag "phone". the most common error is using
>> the national format number instead of the international format.
>>
>> A monthly project 'll maybe fix some of those errors.
>> Some quality tool can help those fix.
>>
>> But the best would be to avoid the mistake when a user fill
>> in the data in iD, josm or whatever.
>>
>> Is anyone aware of a kind of "preset" that can be used for phone ?
>> Otherwise it would be useful to create with local communities a wiki
>> page containing a list of valid prefixes example + 322xxx is valid,
>> +331 also but 01 is not valid in France.
>> Or using something like https://github.com/googlei18n/libphonenumber/
>> https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#where-do-we-get-information-from-to-determine-if-a-number-range-is-valid
>>
>> Would it also be useful to put a corrective suggestion?
>> for example 01 #+331
>>
>> Of course, I am not talking about the exact form of the list,
>> nor the fact that some countries will have a list,
>> while others not.
>> nor the difficulty when a poi has several corresponding numbers
>> attached several countries.
>> I 'm talking about the general guideline.
>>
>> The aim is not to forbid some values but to allow
>> common editor to guide the user to avoid a very common error.
>> ___
>> Tagging mailing list
>> Tagging@openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/tagging
>>
>

___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging


Re: [Tagging] phone validity - phone "preset"

2017-09-05 Thread Tod Fitch
I would not be too hard to make a validity checker for any phone:*=* field. By 
the wiki [1] we should be formatting the number per ITU E.123. That requires a 
leading “+” and a space delimiter between digits groups. [2]

More over, all international telephone numbers need to conform to ITU E.164 [3] 
in order to be called. That specification calls for the full number (including 
the country code, area/city code, exchange and local portion of the number) to 
be no more than 15 digits. In addition, country code starts after the “+” 
symbol. Looking at the assigned country codes, the first thing that is evident 
is that no country code starts with a “0”. [4]

So a simple validator that assures that the string starts with a “+” followed 
by a digit in the range 1..9, containing only the characters 0..9 and space 
with no more than 15 digits will catch a huge number of issues.

Given that the list of country codes is finite and the numbering plans for each 
country is fixed, one could get fancier and assure the correct number and 
format of digits for the jurisdiction. But that would require basically a small 
database that will need maintenance so I would avoid that until it is shown 
that level of error detection is needed.

Been a while since I worked in telephony, but what Wikipedia shows for E.123 
and E.164 looks pretty unchanged from what I remember from back when ITU was 
CCITT.

Cheers!

[1] https://wiki.openstreetmap.org/wiki/Key:phone#Usage
[2] https://en.wikipedia.org/wiki/E.123
[3] https://en.wikipedia.org/wiki/E.164
[4] https://en.wikipedia.org/wiki/List_of_country_calling_codes

> On Sep 5, 2017, at 2:48 PM, Graeme Fitzpatrick  wrote:
> 
> On 6 September 2017 at 02:51, marc marc  > wrote:
> Hello,
> 
> on the french-speaking mailing, a contributor noticed a high rate
> of incorrect value for the tag "phone". the most common error is using
> the national format number instead of the international format.
> 
> I'll admit to being guilty here, in that I enter numbers in my part of 
> Australia as 07, working on the basis that most people using this 
> info to ring the establishment will be making local, or at most, 
> inside-Australia calls. I know, sorry, I should be thinking internationally! 
> :-)
>  
> But the best would be to avoid the mistake when a user fill
> in the data in iD, josm or whatever.
> 
> Is anyone aware of a kind of "preset" that can be used for phone ?
> 
> Would the easiest way be to format the telephone number box so that it has a 
> non-erasable + as the beginning symbol? 
> 
> Thanks
> 
> Graeme
> ___
> Tagging mailing list
> Tagging@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/tagging

___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging


Re: [Tagging] phone validity - phone "preset"

2017-09-05 Thread Graeme Fitzpatrick
On 6 September 2017 at 02:51, marc marc  wrote:

> Hello,
>
> on the french-speaking mailing, a contributor noticed a high rate
> of incorrect value for the tag "phone". the most common error is using
> the national format number instead of the international format.
>

I'll admit to being guilty here, in that I enter numbers in my part of
Australia as 07, working on the basis that most people using this
info to ring the establishment will be making local, or at most,
inside-Australia calls. I know, sorry, I should be thinking
internationally! :-)


> But the best would be to avoid the mistake when a user fill
> in the data in iD, josm or whatever.
>
> Is anyone aware of a kind of "preset" that can be used for phone ?
>

Would the easiest way be to format the telephone number box so that it has
a non-erasable + as the beginning symbol?

Thanks

Graeme
___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging


Re: [Tagging] phone validity - phone "preset"

2017-09-05 Thread Lukas Sommer
It would likely yet help a lot if th editors would simply check if

- the number does not start with “+”
- the number (after the starting “+” sign) contains other characters
then digits, spaces (and maybe dashes).

This is quite simple and could nevertheless catch yet a lot of issues…

2017-09-05 16:51 GMT, marc marc :
> Hello,
>
> on the french-speaking mailing, a contributor noticed a high rate
> of incorrect value for the tag "phone". the most common error is using
> the national format number instead of the international format.
>
> A monthly project 'll maybe fix some of those errors.
> Some quality tool can help those fix.
>
> But the best would be to avoid the mistake when a user fill
> in the data in iD, josm or whatever.
>
> Is anyone aware of a kind of "preset" that can be used for phone ?
> Otherwise it would be useful to create with local communities a wiki
> page containing a list of valid prefixes example + 322xxx is valid,
> +331 also but 01 is not valid in France.
> Or using something like https://github.com/googlei18n/libphonenumber/
> https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#where-do-we-get-information-from-to-determine-if-a-number-range-is-valid
>
> Would it also be useful to put a corrective suggestion?
> for example 01 #+331
>
> Of course, I am not talking about the exact form of the list,
> nor the fact that some countries will have a list,
> while others not.
> nor the difficulty when a poi has several corresponding numbers
> attached several countries.
> I 'm talking about the general guideline.
>
> The aim is not to forbid some values but to allow
> common editor to guide the user to avoid a very common error.
> ___
> Tagging mailing list
> Tagging@openstreetmap.org
> https://lists.openstreetmap.org/listinfo/tagging
>


-- 
Lukas Sommer

___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging


[Tagging] phone validity - phone "preset"

2017-09-05 Thread marc marc
Hello,

on the french-speaking mailing, a contributor noticed a high rate
of incorrect value for the tag "phone". the most common error is using 
the national format number instead of the international format.

A monthly project 'll maybe fix some of those errors.
Some quality tool can help those fix.

But the best would be to avoid the mistake when a user fill
in the data in iD, josm or whatever.

Is anyone aware of a kind of "preset" that can be used for phone ?
Otherwise it would be useful to create with local communities a wiki 
page containing a list of valid prefixes example + 322xxx is valid, 
+331 also but 01 is not valid in France.
Or using something like https://github.com/googlei18n/libphonenumber/
https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#where-do-we-get-information-from-to-determine-if-a-number-range-is-valid

Would it also be useful to put a corrective suggestion?
for example 01 #+331

Of course, I am not talking about the exact form of the list,
nor the fact that some countries will have a list,
while others not.
nor the difficulty when a poi has several corresponding numbers
attached several countries.
I 'm talking about the general guideline.

The aim is not to forbid some values but to allow
common editor to guide the user to avoid a very common error.
___
Tagging mailing list
Tagging@openstreetmap.org
https://lists.openstreetmap.org/listinfo/tagging