This JEP defines a protocol for communicating information about the current geographical location of a Jabber entity.
NOTICE: This JEP is currently within Last Call or under consideration by the Jabber Council for advancement to the next stage in the JSF standards process. For further details, visit <http://www.jabber.org/council/queue.php>.
Type: Standards Track
Last Updated: 2004-09-15
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, JEP-0060
Superseded By: None
Short Name: geoloc
This Jabber Enhancement Proposal is copyright 1999 - 2004 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.php>. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at <http://www.opencontent.org/openpub/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core and XMPP IM specifications contributed by the Jabber Software Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocols defined in this JEP have been developed outside the Internet Standards Process and are to be understood as extensions to XMPP rather than as an evolution, development, or modification of XMPP itself.
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
This JEP defines a format for capturing data about an entity's geographical location (geoloc). The namespace defined herein is intended to provide a semi-structured format for describing a geographical location that may change fairly frequently, where the geoloc information is provided as Global Positioning System (GPS) coordinates. Potential uses for this approach include:
As specified herein, geographical location is captured in terms of GPS coordinates (and associated data) only; a format for communicating temporary changes in physical location (i.e., address) is defined in User Physical Location .
This protocol was designed to address the following requirements:
Information about the entity's geoloc 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 geolocation information itself is provided as the XML character data of the following child elements:
|alt||MAY||xs:int||Altitude in meters above or below sea level|
|bearing||MAY||xs:string||GPS bearing (direction in which the entity is heading to reach its next waypoint)|
|datum||MAY||xs:string||GPS datum |
|description||MAY||xs:string||A natural-language description of the location|
|error||MAY||xs:decimal||Horizontal GPS error in minutes|
|lat||MUST||xs:decimal||Latitude in decimal degrees North|
|lon||MUST||xs:decimal||Longitude in decimal degrees East|
|timestamp||MAY||xs:datetime||UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of Jabber Date and Time Profiles )|
NOTE: The datatypes specified above are defined in XML Schema Part 2 .
The location information SHOULD be communicated by means of Publish-Subscribe . Because location information is not pure presence information and can change independently of the user's availability, it SHOULD NOT be provided as an extension to <presence/>, although an application MAY do so if necessary.
In order to provide information about one's location, Publish-Subscribe SHOULD be used.
<iq type='set' email@example.com' to='pubsub.shakespeare.lit' id='publish1'> <pubsub xmlns='http://jabber.org/protocol/pubsub'> <publish node='n48ad4fj78zn38st734'> <item id='a1s2d3f4g5h6bjeh936'> <geoloc xmlns='http://jabber.org/protocol/geoloc'> <description>Venice</description> <lat>45.44</lat> <lon>12.33</lon> </geoloc> </item> </publish> </pubsub> </iq>
<message from='pubsub.shakespeare.lit' firstname.lastname@example.org'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='n48ad4fj78zn38st734'> <item id='a1s2d3f4g5h6bjeh936'> <geoloc xmlns='http://jabber.org/protocol/geoloc'> <description>Venice</description> <lat>45.44</lat> <lon>12.33</lon> </geoloc> </item> </items> </event> </message>
As mentioned in JEP-0060, the stanza containing the event notification or payload MAY also include 'replyto' data (as specified by the Extended Stanza Addressing  protocol) to provide an explicit association between the published data and the user:
<message from='pubsub.shakespeare.lit' email@example.com'> <event xmlns='http://jabber.org/protocol/pubsub#event'> <items node='n48ad4fj78zn38st734'> <item id='i1s2d3f4g5h6bjeh936'> <geoloc xmlns='http://jabber.org/protocol/geoloc'> <description>Venice</description> <lat>45.44</lat> <lon>12.33</lon> </geoloc> </item> </items> </event> <addresses xmlns='http://jabber.org/protocol/address'> <address type='replyto' firstname.lastname@example.org'/> </addresses> </message>
If an entity wishes to request the location of another entity but the requestee does not publish that information via pubsub, the requestor MAY send an IQ to the requestee:
<iq type='get' id='loc_1' email@example.com/balcony' firstname.lastname@example.org/garden'> <geoloc xmlns='http://jabber.org/protocol/geoloc'/> </iq>
The receiving entity SHOULD make a careful access control decision before returning the actual location.
<iq type='result' id='loc_1' email@example.com/balcony' firstname.lastname@example.org/garden'> <geoloc xmlns='http://jabber.org/protocol/geoloc'> <description>Verona</description> <lat>45.45</lat> <lon>11.00</lon> </geoloc> </iq>
If the receiving entity decides not to return the actual location, it MUST return an IQ error, which SHOULD be <forbidden/> but MAY be some other appropriate error, such as <not-allowed/>:
<iq type='error' id='loc_1' email@example.com/balcony' firstname.lastname@example.org/garden'> <geoloc xmlns='http://jabber.org/protocol/geoloc'/> <error code='403' type='auth'> <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> </error> </iq>
If an entity wants to send another entity its postition but it does not publish that information via pubsub, it MAY do so in a message. There SHOULD be a body element so that receiving entities that do not support this JEP can present a message to the recipient.
<message email@example.com' firstname.lastname@example.org/castle'> <body>This message contains a location.</body> <geoloc xmlns='http://jabber.org/protocol/geoloc'> <description>Elsinore</description> <lat>56.033</lat> <lon>12.618</lon> </geoloc> <x xmlns='jabber:x:oob'> <url> http://www.mapquest.com/maps/map.adp?latlongtype=\ decimal&latitude=56.033&longitude=12.618 </url> <desc>Where would the castle have been?</desc> </x> </message>
If an entity wishes all of the entities on its roster to be informed of a new location, the entity MAY publish a presence stanza that includes a location, although this is NOT RECOMMENDED (since location SHOULD be published using pubsub instead in order to ensure appropriate access control):
<presence> <geoloc xmlns='http://jabber.org/protocol/geoloc'> <alt>1609</alt> <description>Jabber, Inc.</description> <error>10</error> <lat>39.75477</lat> <lon>-104.99768</lon> <timestamp>2004-02-19T21:12Z</timestamp> </geoloc> </presence>
Avoid Mars probe issues. All units are in decimal degrees or meters. South and West are negative.
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 on a jet plane. One possible way to do this would be to send updates at most once per minute.
Inferences MUST NOT be made about accuracy from the number of digits specified in the location or altitude.
Why the datum madness? An example.
A GPS path can be provided by publishing a group of items with appropriate timestamps.
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.
This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) .
Upon advancement of this proposal to a status of Draft, the Jabber Registrar  shall add the 'http://jabber.org/protocol/geoloc' namespace to its registry of protocol namespaces.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://jabber.org/protocol/geoloc' xmlns='http://jabber.org/protocol/geoloc' elementFormDefault='qualified'> <xs:element name='geoloc'> <xs:complexType> <xs:sequence minOccur='0'> <xs:element name='alt' minOccurs='0' type='xs:int'/> <xs:element name='bearing' minOccurs='0' type='xs:string'/> <xs:element name='datum' minOccurs='0' type='xs:string'/> <xs:element name='description' minOccurs='0' type='xs:string'/> <xs:element name='error' minOccurs='0' type='xs:decimal'/> <xs:element name='lat' minOccurs='1' type='xs:decimal'/> <xs:element name='lon' minOccurs='1' type='xs:decimal'/> <xs:element name='timestamp' minOccurs='0' type='xs:datetime'/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
1. JEP-0112: User Physical Location <http://www.jabber.org/jeps/jep-0112.html>.
2. If datum is not included, receiver MUST assume WGS84; receivers MUST implement WGS84; senders MAY use another datum, but it is not recommended.
3. JEP-0082: Jabber Date and Time Profiles <http://www.jabber.org/jeps/jep-0082.html>.
4. XML Schema Part 2: Datatypes <http://www.w3.org/TR/xmlschema-2/>.
5. JEP-0060: Publish-Subscribe <http://www.jabber.org/jeps/jep-0060.html>.
6. JEP-0033: Extended Stanza Addressing <http://www.jabber.org/jeps/jep-0033.html>.
7. 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/>.
8. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.