This document defines a format for capturing data about an entity's geographical location (geoloc). The format defined herein can describe most earthbound geographical locations, especially locations that may change fairly frequently. Potential uses for this approach include:
Geographical location is captured in terms of Global Positioning System (GPS) coordinates as well as civil location (city, street, building, etc.).
The format defined herein was designed to address the following requirements:
Information about the entity's location is provided by the entity and propagated on the network by the entity's associated application (usually a client). The information is structured by means of a <geoloc/> element that is qualified by the 'http://jabber.org/protocol/geoloc' namespace; the location information itself is provided as the XML character data of the following child elements:
|accuracy||xs:decimal||Horizontal GPS error in meters; this element obsoletes the <error/> element||10|
|alt||xs:decimal||Altitude in meters above or below sea level||1609|
|altaccuracy||xs:decimal||Vertical GPS error in meters||10|
|area||xs:string||A named area such as a campus or neighborhood||Central Park|
|bearing||xs:decimal||GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north |
|building||xs:string||A specific building on a street or in an area||The Empire State Building|
|country||xs:string||The nation where the user is located||United States|
|countrycode||xs:string||The ISO 3166 two-letter country code||US|
|datum||xs:string||GPS datum |
|description||xs:string||A natural-language name for or description of the location||Bill's house|
|error||xs:decimal||Horizontal GPS error in arc minutes; this element is deprecated in favor of <accuracy/>||290.8882087|
|floor||xs:string||A particular floor in a building||102|
|lat||xs:decimal||Latitude in decimal degrees North||39.75|
|locality||xs:string||A locality within the administrative region, such as a town or city||New York City|
|lon||xs:decimal||Longitude in decimal degrees East||-104.99|
|postalcode||xs:string||A code used for postal delivery||10118|
|region||xs:string||An administrative region of the nation, such as a state or province||New York|
|room||xs:string||A particular room in a building||Observatory|
|speed||xs:decimal||The speed at which the entity is moving, in meters per second||52.69|
|street||xs:string||A thoroughfare within the locality, or a crossing of two thoroughfares||350 Fifth Avenue / 34th and Broadway|
|text||xs:string||A catch-all element that captures any other information about the location||Northwest corner of the lobby|
|timestamp||xs:dateTime||UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of XMPP Date and Time Profiles (XEP-0082) )||2004-02-19T21:12Z|
|tzo||xs:string||The time zone offset from UTC for the current location (MUST adhere to the Time Zone Definition (TZD) specified in XMPP Date and Time Profiles (XEP-0082) )||-07:00|
|uri||xs:anyURI||A URI or URL pointing to information about the location||http://www.esbnyc.com/|
NOTE: The datatypes specified above are defined in XML Schema Part 2 .
Location information about human users SHOULD be communicated and transported by means of Publish-Subscribe (XEP-0060)  or the subset thereof specified in Personal Eventing Protocol (XEP-0163)  (the examples below assume that the user's XMPP server supports PEP, thus the publish request lacks a 'to' address and the notification message has a 'from' address of the user's bare JID).
Although the XMPP publish-subscribe extension is the preferred means for transporting location information about human users, applications that do not involve human users (e.g., device tracking) MAY use other transport methods; however, because location information is not pure presence information and can change independently of network availability, it SHOULD NOT be provided as an extension to <presence/>.
In order to indicate that the user is no longer publishing any location information, the user's client shall send an empty <geoloc/> element, which can be considered a "stop command" for geolocation:
Avoid "Mars probe" issues: as specified in Table 1, the units for <lat/> and <lon/> MUST be decimal degrees (where South and West are negative, North and East are positive), the units for <alt/> MUST be meters above or below sea level, and the units for <accuracy/> MUST be meters. 
In applications where updates are sent whenever there is a certain distance change in location, those applications SHOULD account for time as well, to avoid rate-limiting when the user is (for example) on a jet plane. One possible way to do this would be to send updates at most once per minute of time (every time 60 seconds have elapsed).
Inferences SHOULD NOT be made about accuracy from the number of digits specified in the location or altitude.
Why the datum madness? See <http://www.xmpp.org/extensions/gps_datum.html> for an example.
An entity can provide a GPS path by publishing a series of items (i.e., multiple pubsub events) with appropriate values of the <timestamp/> element.
There are many XML data formats for physical location or address information. It is beyond the scope of this document to provide a mapping from the extension defined herein to every such format. However, it would be valuable to provide a mapping from the XMPP format to the formats used in other presence or extended presence protocols. The two main protocols of interest are:
The Wireless Village (now "IMPS") specifications for mobile instant messaging; these specifications define a presence attribute for address information as encapsulated in the IMPS "Address" element .
The SIP-based SIMPLE specifications; in particular, the IETF's GEOPRIV Working Group has defined an extension to the IETF's Presence Information Data Format (PIDF)  for location information, as specified in RFC 4119  (also known as "PIDF-LO").
The following table also maps the format defined herein to the vCard XML format specified in vcard-temp (XEP-0054) .
|XMPP||Wireless Village / IMPS||SIMPLE (PIDF-LO)||vCard XML|
|<region/>||--||<A1/> and/or <A2/>||<REGION/>|
|<area/>||<NamedArea/>||<A4/> and/or <A5/>||--|
|<street/>||<Street/> ||<A6/> ||<STREET/>|
Because the character data contained in <geoloc/> child elements of type 'xs:string' is intended to be readable by humans, the <geoloc/> element SHOULD possess an 'xml:lang' attribute specifying the natural language of such character data.
It is imperative to control access to location information, at least by default. Imagine that a stalker got unauthorized access to this information, with enough accuracy and timeliness to be able to find the target person. This scenario could lead to loss of life, so please take access control checks seriously. If an error is deliberately added to a location, the error SHOULD be the same for all receivers, to minimize the likelihood of triangulation. In the case of deliberate error, the <accuracy/> element SHOULD NOT be included.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) .
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2020 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <email@example.com> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <firstname.lastname@example.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. It is the responsibility of the receiver to translate bearing into decimal degrees relative to magnetic north, if desired.
2. If datum is not included, receiver MUST assume WGS84; receivers MUST implement WGS84; senders MAY use another datum, but it is not recommended.
7. The <accuracy/> element obsoletes the older <error/> element, which specified units of arc minutes intead of meters.
8. The Wireless Village Initiative: Presence Attributes v1.1 (WV-029); for further information, visit <http://www.openmobilealliance.org/tech/affiliates/wv/wvindex.html>.
12. As noted in XEP-0054, the XML vCard format defined in draft-dawson-vcard-xml-dtd-01 specified a <COUNTRY/> element rather than a <CTRY/> element; refer to XEP-0054 for details.
13. The IMPS specification also enables one to define an intersection (e.g., "Broadway and 34th Street") as the combination of a <Crossing1/> element (e.g., "Broadway") and a <Crossing2/> element (e.g., "34th Street"). To map from IMPS to XMPP, an application SHOULD map such a combination to one XMPP <street/> element.
14. The PIDF-LO format provides information elements for much more granular control over a traditional street address; in PIDF-LO the <A6/> element is the street name only, and further information is provided in distinct elements for a leading street direction (e.g., "N"), trailing street suffix (e.g., "SW"), street suffix (e.g., "Avenue"), house number (e.g., "909"), and house number suffix (e.g., "1/2"). To map from PIDF-LO to XMPP, an application SHOULD construct the complete street address from the PIDF-LO elements (<A6/>, <PRD/>, <POD/>, <STS/>, <HNO/>, and <HNS/>) and map the result to one XMPP <street/> element.
15. This element specifies accuracy in meters. When mapping from IMPS to XMPP, the IMPS <Accuracy/> element SHOULD be mapped to the XMPP <accuracy/> element (which specifies accuracy in meters), not the deprecated <error/> element (which specified accuracy in arc minutes).
16. This element provides a name for the location, e.g., a certain store in a building. This SHOULD be mapped to the XMPP <text/> element.
17. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
18. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Added <altaccuracy/> element.
Added <tzo/> element.
Added <countrycode/> element.
Allowed empty geoloc element to signify a pause in publishing; added <accuracy/> element and deprecated <error/> element to change horizontal GPS error from arc minutes to meters, consistent with IMPS and other formats.
Added speed element.
Renamed to User Location; corrected pubsub examples; recommended pubsub/PEP as transport for location information about human users; added uri element.
Folded in civil location from XEP-0112.
Changed xs:string to xs:decimal for bearing and specified that bearing is to be interpreted as decimal degrees relative to true north.
Changed xs:int to xs:decimal for altitude; changed MUST NOT to SHOULD NOT regarding inferences about accuracy.
Per a vote of the Jabber Council, advanced status to Draft; also added internationalization considerations and linked to an archived version of the GPS datum example.
Clarified several points in the implementation notes.
Specified error flow for IQ example.
Corrected several errors; added reference to XEP-0033.
Reverted from infobits to geoloc elements; moved physical address protocol back to XEP-0112.
Converted to use of infobits.
Merged in contents of XEP-0112.
Changed protocol name from 'location' to 'geoloc'.
Incorporated Standards list feedback; changed document type to Informational.