JEP-0080: User Geolocation

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>.


JEP Information

Status: Proposed
Type: Standards Track
Number: 0080
Version: 0.8
Last Updated: 2004-09-15
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, JEP-0060
Supersedes: None
Superseded By: None
Short Name: geoloc

Author Information

Joe Hildebrand

Email: jhildebrand@jabber.com
JID: hildjj@jabber.org

Peter Saint-Andre

Email: stpeter@jabber.org
JID: stpeter@jabber.org

Legal Notice

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/>).

Discussion Venue

The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.

Relation to XMPP

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.

Conformance Terms

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.


Table of Contents

1. Introduction
2. Requirements
3. Protocol
4. Use Cases
4.1. Entity publishes location via pubsub
4.2. Entity requests the location of another entity
4.3. Sending location
4.4. Entity publishes location in presence
5. Implementation Notes
6. Security Considerations
7. IANA Considerations
8. Jabber Registrar Considerations
8.1. Protocol Namespaces
9. XML Schema
Notes
Revision History


1. Introduction

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 [1].

2. Requirements

This protocol was designed to address the following requirements:

3. Protocol

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:

Table 1: Child Elements

Element Name Inclusion Datatype Definition
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 [2]
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 [3])

NOTE: The datatypes specified above are defined in XML Schema Part 2 [4].

The location information SHOULD be communicated by means of Publish-Subscribe [5]. 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.

4. Use Cases

4.1 Entity publishes location via pubsub

In order to provide information about one's location, Publish-Subscribe SHOULD be used.

Example 1. Entity publishes location

<iq type='set' 
    from='portia@merchantofvenice.lit' 
    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>
    

Example 2. Subscriber receives event with payload

<message from='pubsub.shakespeare.lit'
         to='bassanio@merchantofvenice.lit'>
  <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 [6] protocol) to provide an explicit association between the published data and the user:

Example 3. Event notification with extended stanza addressing

<message from='pubsub.shakespeare.lit'
         to='bassanio@merchantofvenice.lit'>
  <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' jid='portia@merchantofvenice.lit'/>
  </addresses>
</message>
    

4.2 Entity requests the location of another entity

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:

Example 4. Location request

<iq type='get' 
    id='loc_1'
    from='juliet@capulet.com/balcony'
    to='romeo@montague.net/garden'>
  <geoloc xmlns='http://jabber.org/protocol/geoloc'/>
</iq>

The receiving entity SHOULD make a careful access control decision before returning the actual location.

Example 5. Successful location response

<iq type='result' 
    id='loc_1'
    to='juliet@capulet.com/balcony'
    from='romeo@montague.net/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/>:

Example 6. Access to location information denied

<iq type='error' 
    id='loc_1'
    to='juliet@capulet.com/balcony'
    from='romeo@montague.net/garden'>
  <geoloc xmlns='http://jabber.org/protocol/geoloc'/>
  <error code='403' type='auth'>
    <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  </error>
</iq>
    

4.3 Sending location

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.

Example 7. Message containing location

<message 
    to='polonius@hamlet.lit'
    from='horatio@hamlet.lit/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>

4.4 Entity publishes location in presence

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):

Example 8. Location in presence

<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>

5. Implementation Notes

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.

6. Security Considerations

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.

7. IANA Considerations

This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) [7].

8. Jabber Registrar Considerations

8.1 Protocol Namespaces

Upon advancement of this proposal to a status of Draft, the Jabber Registrar [8] shall add the 'http://jabber.org/protocol/geoloc' namespace to its registry of protocol namespaces.

9. XML Schema

<?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>
  


Notes

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/>.


Revision History

Version 0.8 (2004-09-15)

Specified error flow for IQ example. (psa)

Version 0.7 (2004-04-25)

Corrected several errors; added reference to JEP-0033. (psa)

Version 0.6 (2004-02-19)

Reverted from infobits to geoloc elements; moved physical address protocol back to JEP-0112. (psa)

Version 0.5 (2003-12-16)

Converted to use of infobits. (psa)

Version 0.4 (2003-09-08)

Merged in contents of JEP-0112. (psa)

Version 0.3 (2003-08-21)

Changed protocol name from 'location' to 'geoloc'. (psa)

Version 0.2 (2003-07-29)

Incorporated Standards JIG feedback; changed JEP type to Informational. (psa)

Version 0.1 (2003-04-15)

Initial version. (jjh)


END