<abstract>This specification defines an XMPP protocol extension for communicating information about the current geographical or physical location of an entity.</abstract>
<remark><p>Renamed to User Location; corrected pubsub examples; recommended pubsub/PEP as transport for location information about human users; added uri element.</p></remark>
<remark><p>Changed xs:string to xs:decimal for bearing and specified that bearing is to be interpreted as decimal degrees relative to true north.</p></remark>
</revision>
<revision>
<version>1.1</version>
<date>2004-10-29</date>
<initials>psa</initials>
<remark><p>Changed xs:int to xs:decimal for altitude; changed MUST NOT to SHOULD NOT regarding inferences about accuracy.</p></remark>
</revision>
<revision>
<version>1.0</version>
<date>2004-10-12</date>
<initials>psa</initials>
<remark><p>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.</p></remark>
</revision>
<revision>
<version>0.9</version>
<date>2004-10-12</date>
<initials>psa</initials>
<remark><p>Clarified several points in the implementation notes.</p></remark>
</revision>
<revision>
<version>0.8</version>
<date>2004-09-15</date>
<initials>psa</initials>
<remark><p>Specified error flow for IQ example.</p></remark>
<p>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:</p>
<ul>
<li>Publishing location information to a set of subscribers.</li>
<li>Querying another entity for its location.</li>
<li>Sending location information to another entity.</li>
<li>Attaching location information to presence.</li>
</ul>
<p>Geographical location is captured in terms of Global Positioning System (GPS) coordinates as well as civil location (city, street, building, etc.).</p>
</section1>
<section1topic='Requirements'anchor='reqs'>
<p>The format defined herein was designed to address the following requirements:</p>
<ul>
<li>It shall be possible to encapsulate location in terms of Global Positioning System (GPS) coordinates as well as civil location (city, street, building, etc.).</li>
<li>The GPS encoding mechanism shall have a single set of units, so that receivers do not need to use heuristics to determine an entity's position.</li>
<li>It shall be possible to specify the known amount of error in the GPS coordinates.</li>
<li>It shall be possible to include a natural-language description of the location.</li>
<p>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:</p>
<td>Altitude in meters above or below sea level</td>
<td>1609</td>
</tr>
<tr>
<td>area</td>
<td>xs:string</td>
<td>A named area such as a campus or neighborhood</td>
<td>Central Park</td>
</tr>
<tr>
<td>bearing</td>
<td>xs:decimal</td>
<td>GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north <note>It is the responsibility of the receiver to translate bearing into decimal degrees relative to magnetic north, if desired.</note></td>
<td> </td>
</tr>
<tr>
<td>building</td>
<td>xs:string</td>
<td>A specific building on a street or in an area</td>
<td>The Empire State Building</td>
</tr>
<tr>
<td>country</td>
<td>xs:string</td>
<td>The nation where the user is located</td>
<td>USA</td>
</tr>
<tr>
<td>datum</td>
<td>xs:string</td>
<td>GPS datum <note>If datum is not included, receiver MUST assume WGS84; receivers MUST implement WGS84; senders MAY use another datum, but it is not recommended.</note></td>
<td> </td>
</tr>
<tr>
<td>description</td>
<td>xs:string</td>
<td>A natural-language name for or description of the location</td>
<td>Bill's house</td>
</tr>
<tr>
<td>error</td>
<td>xs:decimal</td>
<td>Horizontal GPS error in arc minutes</td>
<td>10</td>
</tr>
<tr>
<td>floor</td>
<td>xs:string</td>
<td>A particular floor in a building</td>
<td>102</td>
</tr>
<tr>
<td>lat</td>
<td>xs:decimal</td>
<td>Latitude in decimal degrees North</td>
<td>39.75</td>
</tr>
<tr>
<td>locality</td>
<td>xs:string</td>
<td>A locality within the administrative region, such as a town or city</td>
<td>New York City</td>
</tr>
<tr>
<td>lon</td>
<td>xs:decimal</td>
<td>Longitude in decimal degrees East</td>
<td>-104.99</td>
</tr>
<tr>
<td>postalcode</td>
<td>xs:string</td>
<td>A code used for postal delivery</td>
<td>10027</td>
</tr>
<tr>
<td>region</td>
<td>xs:string</td>
<td>An administrative region of the nation, such as a state or province</td>
<p>Location information about human users SHOULD be communicated and transported by means of &xep0060; or the subset thereof specified in &xep0163; (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).</p>
<p>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;.</p>
<p>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:</p>
<p>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 <error/> MUST be arc minutes.</p>
<p>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).</p>
<p>Inferences SHOULD NOT be made about accuracy from the number of digits specified in the location or altitude.</p>
<p>Why the datum madness? See <<linkurl='http://www.xmpp.org/extensions/gps_datum.html'>http://www.xmpp.org/extensions/gps_datum.html</link>> for an example.</p>
<p>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.</p>
</section1>
<section1topic='Mapping to Other Formats'anchor='mapping'>
<p>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:</p>
<ol>
<li><p>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 <note>The Wireless Village Initiative: Presence Attributes v1.1 (WV-029); for further information, visit <<linkurl='http://www.openmobilealliance.org/tech/affiliates/wv/wvindex.html'>http://www.openmobilealliance.org/tech/affiliates/wv/wvindex.html</link>>.</note>.</p></li>
<li><p>The SIP-based SIMPLE specifications; in particular, the IETF's GEOPRIV Working Group has defined an extension to the IETF's &pidf; for location information, as specified in &rfc4119; (also known as "PIDF-LO").</p></li>
<note>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.</note>
<note>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.</note>
</td>
<tdalign='center'><A6/>
<note>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.</note>
<note>This element provides accuracy in meters. The location protocol defined in XEP-0080 specifies such an element for XMPP, which SHOULD be used when mapping from IMPS to XMPP.</note>
<note>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.</note>
<p>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.</p>
<p>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 <error/> element SHOULD NOT be included.</p>