Key:phone

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages
Deutsch English español français 日本語 русский
Public-images-osm logo.svg phone
Phone number on a shop.jpg
Description
A telephone number associated with the object.
Group: Annotation
Used on these elements
may be used on nodes
may be used on ways
may be used on areas
use on relations unspecified
Status: Unspecified

A telephone number associated with a POI.

Summary

Sometimes it is useful to associate a phone number with an object, especially for business, leisure or amenities. A shop, a museum or a pub for example. The object can be on a node or a area. Clearly phone is always an additional descriptive tag to be added alongside other more important tags which denote what the object actually is.

phone=* is widely used and accepted by many mappers but verify that you are not violating data privacy laws in your country (especially for private phone numbers).

Usage

  • phone=number where the number should be in international (ITU-T E.164) format
    • phone=+<country code> <area code> <local number>, following the ITU-T E.123 and the DIN 5008 pattern
    • (phone=+<country code>-<area code>-<local number>, following the RFC 3966/NANP pattern)

If your country does not use area codes, that part should be left out.

fax=number may be used in the same way.

Some countries have very well established national standards on how telephone numbers are written (e.g. xxx-xxx-xxxx in the US) which leads to mappers in those countries preferring that format over the aforementioned standards.

How to map

Just add the phone=number tag to any map object that has a phone, following the format described above.

Examples

The illustration shown in the top-right is a shop in the UK (code 44), in London (area 20), so could be tagged with phone=+44 20 8452 7891. Italy does not omit the 0 in the international format like many countries do, so the Milan number 02.724261 becomes phone=+39 02 724261 in OSM.

Phone numbers of telephone boxes

Even phone boxes have telephone numbers. Don't be confused. Telephone boxes must always be tagged with amenity=telephone to describe what the object is. You can add the phone=* tag to supply the extra detail of its telephone number (depending on how diligent you feel like being).

phone=+49 4721 28695 for a public phone box on the German island Neuwerk.

Parsing phone numbers

Clearly it will be dangerous to assume that mappers have followed the above format correctly. Code using this tag might defensively reject or attempt to correct possible formatting errors. Specific things to note:

  • When dialling the '-'-signs have to be omitted
  • If the '+'-sign is not supported, it has to be replaced by the local international call prefix; e.g., 00. The dialling device has to be configured accordingly.

Support for multiple countries

Some amenities provide a different phone number for different countries (most seen when the amenity is on a country boundary, or an international company). As I was wondering how to map this, I used the following schema:

  • phone=+32 57 536245 for the country where the amenity is
  • phone:be=+32 57 536245 and phone:fr=+33 6 12654478 for different national phone numbers. Note that the country code is used, not the language code.

This makes sure tools don't have to adapt for those few border cases, and the OSM data is complete.

Applications / Web services that display or dial the number from OSM

  • Offmaps (iPhone): Displays and dials the phone number in the app's downloadable City Guides.
  • OsmAnd: Displays and dials the phone number of all types of indexed POI.
  • OpenLinkMap: A slippy map, making this tag's data available as clickable POIs

See also