No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0255.xml 39KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Location Query</title>
  10. <abstract>This specification defines an XMPP protocol extension for querying a compliant server or service for information about the geographical or physical location of an entity.</abstract>
  12. <number>0255</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <approver>Council</approver>
  17. <dependencies>
  18. <spec>XMPP Core</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>NOT_YET_ASSIGNED</shortname>
  23. <author>
  24. <firstname>Helge</firstname>
  25. <surname>Timenes</surname>
  26. <email></email>
  27. <jid></jid>
  28. </author>
  29. <author>
  30. <firstname>Simon</firstname>
  31. <surname>Tennant</surname>
  32. <email></email>
  33. <jid></jid>
  34. </author>
  35. <author>
  36. <firstname>Ross</firstname>
  37. <surname>Savage</surname>
  38. <email></email>
  39. <jid></jid>
  40. </author>
  41. <revision>
  42. <version>0.6</version>
  43. <date>2009-04-09</date>
  44. <initials>psa</initials>
  45. <remark><p>Defined registry; added nic type from list discussion.</p></remark>
  46. </revision>
  47. <revision>
  48. <version>0.5</version>
  49. <date>2009-03-13</date>
  50. <initials>ht</initials>
  51. <remark>
  52. <ul>
  53. <li>Added example with IP address</li>
  54. <li>Corrected closing &lt;/iq&gt; tags in examples</li>
  55. </ul>
  56. </remark>
  57. </revision>
  58. <revision>
  59. <version>0.4</version>
  60. <date>2009-02-17</date>
  61. <initials>ht</initials>
  62. <remark>
  63. <ul>
  64. <li>Added IP address to the type of beacons</li>
  65. <li>Changed the nomenclature from 'beacons' to 'references' as they may not always be active transmitters (as in the case of IP address)</li>
  66. <li>Corrected &lt;latitude/&gt; and &lt;longitude/&gt; and tags in example 1 to &lt;lat/&gt; and &lt;lon/&gt;</li>
  67. </ul>
  68. </remark>
  69. </revision>
  70. <revision>
  71. <version>0.3</version>
  72. <date>2008-12-20</date>
  73. <initials>ht</initials>
  74. <remark>
  75. <ul>
  76. <li>Corrected name-space in section 10.1.</li>
  77. <li>Removed extra 's in example 7 </li>
  78. <li>Made time-stamp optional</li>
  79. <li>Added optional time-stamp to beacon element</li>
  80. <li>Added comment reflecting that query time-stamp applies to GPS coordinates if beacons provide own time-stamps</li>
  81. <li>Updated schema to reflect changes.</li>
  82. </ul>
  83. </remark>
  84. </revision>
  85. <revision>
  86. <version>0.2</version>
  87. <date>2008-12-17</date>
  88. <initials>ht</initials>
  89. <remark>
  90. <ul>
  91. <li>Updated examples to be conform with XEP-0080 (use lat and lon instead of latitude and longitude).</li>
  92. <li>Fixed wrong closing tag for &lt;type&gt; in examples.</li>
  93. <li>Added signal strength to beacon data.</li>
  94. </ul>
  95. </remark>
  96. </revision>
  97. <revision>
  98. <version>0.1</version>
  99. <date>2008-11-13</date>
  100. <initials>psa</initials>
  101. <remark><p>Initial published version.</p></remark>
  102. </revision>
  103. <revision>
  104. <version>0.0.3</version>
  105. <date>2008-11-07</date>
  106. <initials>ht</initials>
  107. <remark>
  108. <ul>
  109. <li>Removed &lt;error/&gt; child of geoloc element (arc minutes).</li>
  110. <li>Added &lt;accuracy/&gt; (meters).</li>
  111. <li>Updated notes on GPS data submitted in location query.</li>
  112. <li>Replaced language encoding 'en-UK' with 'en-US' to avoid UK/GB confusion.</li>
  113. </ul>
  114. </remark>
  115. </revision>
  116. <revision>
  117. <version>0.0.2</version>
  118. <date>2008-11-03</date>
  119. <initials>ht</initials>
  120. <remark>
  121. <ul>
  122. <li>Corrected XML namespace.</li>
  123. <li>Added country code reference.</li>
  124. </ul>
  125. </remark>
  126. </revision>
  127. <revision>
  128. <version>0.0.1</version>
  129. <date>2008-10-28</date>
  130. <initials>ht/st/rs</initials>
  131. <remark><p>First draft.</p></remark>
  132. </revision>
  133. </header>
  134. <section1 topic='Introduction' anchor='intro'>
  135. <p>This document defines a format for querying a location server for information about an entity's geographical location. The query must contain some location characteristics that the server can process to derive this information. These can be in the form of geodetic coordinates (from GPS receivers or other positioning equipment), in which case the server will perform "reversed geocoding" to derive the information. Alternatively, the location can be characterized by a geographically assigned IP address or a list of cellular telephone towers, wireless network access points, Bluetooth devices, RFID tags, network addresses, or other information observable from this location (from here on called 'location references', or just 'references'). In this case the location server must match the supplied characteristics with stored knowledge about the location references to derive the submitting entity's location. Client implementers are encouraged to supply both kinds of characteristics when available, as this can be utilized by self-learning location servers. The location information returned by the location server is structured according to &xep0080;, ensuring compatibility with systems using this standard for location information publishing.</p>
  136. <p>The location query is designed to be used as a one-shot request or as a continuous query-result dialogue. The latter form will allow location servers to analyze changes with time, which in most cases yields improved fidelity and the possibility to derive motion state information.</p>
  137. </section1>
  138. <section1 topic='Requirements' anchor='reqs'>
  139. <p>The format defined herein was designed to address the following requirements:</p>
  140. <ul>
  141. <li>It shall be usable on devices with no support for GPS or other geodetic positioning systems</li>
  142. <li>It shall be usable on devices with support for GPS or other geodetic positioning systems</li>
  143. <li>It shall be compatible with place-referencing systems</li>
  144. <li>It shall support self-learning location servers</li>
  145. <li>The result format shall be expressed as natural language location description</li>
  146. <li>The result format shall be compatible with XEP-0080</li>
  147. </ul>
  148. </section1>
  149. <section1 topic='How It Works' anchor='examples'>
  150. <p>The basic principle behind this XMPP extension is as follows: An XMPP clients collects characteristics about its current location that is not directly suitable for presentation to a human user, but from which human readable location information can be derived. The client sends this information to a location server that derives this information and returns it to the querying client. Here "location server" means a XMPP server application that supports the &lt;locationquery/&gt; payload defined in this document. It can either be an integral part of the XMPP server, or run as a component on the same or a different machine from the XMPP server itself.</p>
  151. <example caption='Entity queries server with GPS coordinates'><![CDATA[
  152. <iq from='hamlet@shakespeare.lit/phone'
  153. id='q01'
  154. to='location.shakespear.lit'
  155. type='get'
  156. xml:lang='en-US'>
  157. <locationquery xmlns='urn:xmpp:locationquery:0'>
  158. <lat>57.0501862</lat>
  159. <lon>9.9188746</lon>
  160. <accuracy>35.6</accuracy>
  161. </locationquery>
  162. </iq>
  163. ]]></example>
  164. <example caption='Server responds with location info'><![CDATA[
  165. <iq from='location.shakespeare.lit'
  166. id='q01'
  167. to='hamlet@shakespeare.lit/phone'
  168. type='result'
  169. xml:lang='en-US'>
  170. <geoloc xmlns='' xml:lang='en'>
  171. <timestamp>1599-10-23T01:56:05Z</timestamp>
  172. <lat>57.0501862</lat>
  173. <lon>9.9188746</lon>
  174. <accuracy>35.6</accuracy>
  175. <street>Jomfru Ane Gade 13</street>
  176. <locality>Aalborg</locality>
  177. <country>Denmark</country>
  178. <uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
  179. <text>Near King's Head Pub</text>
  180. </geoloc>
  181. </iq>
  182. ]]></example>
  183. <example caption='Entity queries server with IP address'><![CDATA[
  184. <iq from='hamlet@shakespeare.lit/phone'
  185. id='q02'
  186. to='location.shakespear.lit'
  187. type='get'
  188. xml:lang='en-US'>
  189. <locationquery xmlns='urn:xmpp:locationquery:0'>
  190. <reference>
  191. <id></id>
  192. <type>ip</type>
  193. </reference>
  194. </locationquery>
  195. </iq>
  196. ]]></example>
  197. <example caption='Server responds with location info'><![CDATA[
  198. <iq from='location.shakespeare.lit'
  199. id='q02'
  200. to='hamlet@shakespeare.lit/phone'
  201. type='result'
  202. xml:lang='en-US'>
  203. <geoloc xmlns='' xml:lang='en'>
  204. <timestamp>1599-10-23T01:56:05Z</timestamp>
  205. <lat>56.8</lat>
  206. <lon>9.9</lon>
  207. <accuracy>100000</accuracy>
  208. <locality>Aalborg</locality>
  209. <country>Denmark</country>
  210. </geoloc>
  211. </iq>
  212. ]]></example>
  213. <example caption='Entity queries server with cell tower and wifi access point IDs'><![CDATA[
  214. <iq from='hamlet@shakespeare.lit/phone'
  215. id='q03'
  216. to='location.shakespear.lit'
  217. type='get'
  218. xml:lang='en-US'>
  219. <locationquery xmlns='urn:xmpp:locationquery:0'>
  220. <reference>
  221. <id>238:02:34775:50880</id>
  222. <type>cell</type>
  223. </reference>
  224. <reference>
  225. <id>00:0F:3D:42:92:2A</id>
  226. <type>wifi</type>
  227. </reference>
  228. <reference>
  229. <id>00:19:CB:45:50:4A</id>
  230. <type>wifi</type>
  231. </reference>
  232. </locationquery>
  233. </iq>
  234. ]]></example>
  235. <example caption='Server responds with location info'><![CDATA[
  236. <iq from='location.shakespeare.lit'
  237. id='q03'
  238. to='hamlet@shakespeare.lit/phone'
  239. type='result'
  240. xml:lang='en-US'>
  241. <geoloc xmlns='' xml:lang='en'>
  242. <timestamp>1599-10-23T01:56:05Z</timestamp>
  243. <lat>57.050122</lat>
  244. <lon>9.918833</lon>
  245. <locality>Aalborg</locality>
  246. <street>Jomfru Ane Gade 13</street>
  247. <country>Denmark</country>
  248. <accuracy>20</accuracy>
  249. <uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
  250. <text>King's Head Pub</text>
  251. </geoloc>
  252. </iq>
  253. ]]></example>
  254. <example caption='Entity queries server with reference info from multiple cell tower and wifi accespoint scans and specifies that results should be published'><![CDATA[
  255. <iq from='hamlet@shakespeare.lit/phone'
  256. id='q04'
  257. to='location.shakespear.lit'
  258. type='get'
  259. xml:lang='en-US'>
  260. <locationquery xmlns='urn:xmpp:locationquery:0'>
  261. <timestamp>1599-10-23T01:55:21Z</timestamp>
  262. <lat>57.0501862</lat>
  263. <lon>9.918874</lon>
  264. <accuracy>33.56</accuracy>
  265. <publish>true</publish>
  266. <reference>
  267. <id>238:02:34775:50880</id>
  268. <type>cell</type>
  269. <signalstrength>-88</signalstrength>
  270. <timestamp>1599-10-23T01:55:21Z</timestamp>
  271. </reference>
  272. <reference>
  273. <id>238:02:34775:48770</id>
  274. <type>cell</type>
  275. <signalstrength>-76</signalstrength>
  276. <timestamp>1599-10-23T01:52:34Z</timestamp>
  277. </reference>
  278. <reference>
  279. <id>00:0F:3D:42:92:2A</id>
  280. <type>wifi</type>
  281. <signalstrength>-64</signalstrength>
  282. <timestamp>1599-10-23T01:55:21Z</timestamp>
  283. </reference>
  284. <reference>
  285. <id>238:02:34775:50880</id>
  286. <type>cell</type>
  287. <signalstrength>-88</signalstrength>
  288. <timestamp>1599-10-23T01:55:21Z</timestamp>
  289. </reference>
  290. <reference>
  291. <id>00:19:CB:45:50:4A</id>
  292. <type>wifi</type>
  293. <signalstrength>-82</signalstrength>
  294. <timestamp>1599-10-23T01:52:24Z</timestamp>
  295. </reference>
  296. <reference>
  297. <id>00:18:42:E6:71:51</id>
  298. <type>bluetooth</type>
  299. </reference>
  300. </locationquery>
  301. </iq>
  302. ]]></example>
  303. <example caption='Server responds with empty IQ-result...'><![CDATA[
  304. <iq from='location.shakespeare.lit'
  305. id='q04'
  306. to='hamlet@shakespeare.lit/phone'
  307. type='result'
  308. xml:lang='en-US' />
  309. ]]></example>
  310. <example caption='...and publishes result to the entity&apos;s geoloc pubsub node...'><![CDATA[
  311. <iq from='hamlet@shakespeare.lit/phone'
  312. id='q04'
  313. to='hamlet@shakespeare.lit/phone'
  314. type='set'
  315. xml:lang='en-US'>
  316. <pubsub xmlns=''>
  317. <publish>
  318. <node xmlns=''>
  319. <item>
  320. <geoloc xmlns='' xml:lang='en'>
  321. <timestamp>1599-10-23T01:56:05Z</timestamp>
  322. <lat>57.0501862</lat>
  323. <lon>9.918874</lon>
  324. <street>Jomfru Ane Gade 13</street>
  325. <locality>Aalborg</locality>
  326. <country>Denmark</country>
  327. <accuracy>20</accuracy>
  328. <uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
  329. <text>King's Head Pub</text>
  330. </geoloc>
  331. </item>
  332. </node>
  333. </publish>
  334. </pubsub>
  335. </iq>
  336. ]]></example>
  337. <example caption='...which is delivered to everyone subscribing to it'><![CDATA[
  338. <message from='hamlet@shakespeare.lit' to='hamlet@shakespeare.lit/phone'>
  339. <event xmlns=''>
  340. <items node=''>
  341. <item id='4C940F61C13A0'>
  342. <geoloc xmlns='' xml:lang='en'>
  343. <timestamp>1599-10-23T01:56:05Z</timestamp>
  344. <lat>57.0501862</lat>
  345. <lon>9.918874</lon>
  346. <street>Jomfru Ane Gade 13</street>
  347. <locality>Aalborg</locality>
  348. <country>Denmark</country>
  349. <accuracy>20</accuracy>
  350. <uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
  351. <text>King's Head Pub</text>
  352. </geoloc>
  353. </item>
  354. </items>
  355. </event>
  356. </message>
  357. <message from='hamlet@shakespeare.lit' to='horatio@shakespeare.lit/pda'>
  358. <event xmlns=''>
  359. <items node=''>
  360. <item id='4C940F61C13A0'>
  361. <geoloc xmlns='' xml:lang='en'>
  362. <timestamp>1599-10-23T01:56:05Z</timestamp>
  363. <lat>57.0501862</lat>
  364. <lon>9.918874</lon>
  365. <street>Jomfru Ane Gade 13</street>
  366. <locality>Aalborg</locality>
  367. <country>Denmark</country>
  368. <accuracy>20</accuracy>
  369. <uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
  370. <text>King's Head Pub</text>
  371. </geoloc>
  372. </item>
  373. </items>
  374. </event>
  375. </message>
  376. ]]></example>
  377. </section1>
  378. <section1 topic='Data Format' anchor='format'>
  379. <p>Information about location references in the entity's surrounding, and, if available, the entity's own geodetic coordinates, are 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 &lt;locationquery/&gt; element that is qualified by the 'urn:xmpp:locationquery:0' namespace and nested with in a &lt;iq&gt; element with type set to <em>get</em>. The location result is provided by the location server and returned to the client in a &lt;iq&gt; element with type set to <em>result</em>. The location result is structured by means of a &lt;geoloc/&gt; element that is qualified by the '' namespace (see <link url="xep-0080.html">XEP-0080</link>).</p>
  380. <table caption='Location Query Child Elements'>
  381. <tr>
  382. <th>Element Name</th>
  383. <th>Datatype</th>
  384. <th>Definition</th>
  385. <th>Example</th>
  386. <th>Notes</th>
  387. </tr>
  388. <tr>
  389. <td>timestamp</td>
  390. <td>xs:datetime</td>
  391. <td>UTC time-stamp (MUST conform to the DateTime profile of &xep0082;). </td>
  392. <td>2004-02-19T21:12Z</td>
  393. <td>Optional. If individual location references contain own timing information, this time-stamp shall represent GPS time only, otherwise it shall represent all provided info in the query. If not set, the server may assume current time.</td>
  394. </tr>
  395. <tr>
  396. <td>publish</td>
  397. <td>xs:boolean</td>
  398. <td>A flag specifying whether or not the server should publish the location result to subscribers of the submitting user's XEP-0080 compatible geoloc pub-sub node instead of returning it directly to the submitting user.</td>
  399. <td>true</td>
  400. <td>Optional. If present and "true", the server shall publish the entity's location details whenever it changes (suitable for periodic queries) and respond to the query with an empty &lt;iq&gt; stanza with type set to "result". If not specified or "false" the server shall return the location results to the submitting user in the form of a geoloc stanza (XEP-0080) embedded in a &lt;iq&gt; with type set to "result". Default is "false"</td>
  401. </tr>
  402. <tr>
  403. <td>lat</td>
  404. <td>xs:decimal</td>
  405. <td>Latitude in decimal degrees
  406. North.</td>
  407. <td>39.75</td>
  408. <td>Required if no location references present, otherwise optional. If present, this shall also be present in the result stanza. If not present, the location server SHOULD estimate a value based on submitted reference data and return with result stanza. The location server is free to decide if the value of this field should be piped directly through to result, or if it should be modified based on reference data or time history information. For instance: if the entity is indoors, the GPS signal will be inaccurate and unstable over time. If wifi references are submitted, the location server may decide that the entity is inside a known building, and return the latitude of this instead.</td>
  409. </tr>
  410. <tr>
  411. <td>lon</td>
  412. <td>xs:decimal</td>
  413. <td>Longitude in decimal degrees East</td>
  414. <td>-104.99</td>
  415. <td>See notes for <em>lat</em></td>
  416. </tr>
  417. <tr>
  418. <td>alt</td>
  419. <td>xs:decimal</td>
  420. <td>Altitude in meters above or below sea level</td>
  421. <td>1609</td>
  422. <td>Optional. If present, this shall also be present in the result stanza with identical value.</td>
  423. </tr>
  424. <tr>
  425. <td>bearing</td>
  426. <td>xs:decimal</td>
  427. <td>GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north</td>
  428. <td> </td>
  429. <td>See notes for <em>alt</em></td>
  430. </tr>
  431. <tr>
  432. <td>datum</td>
  433. <td>xs:string</td>
  434. <td>GPS datum (See XEP-0080)</td>
  435. <td> </td>
  436. <td>See notes for <em>alt</em></td>
  437. </tr>
  438. <tr>
  439. <td>accuracy</td>
  440. <td>xs:decimal</td>
  441. <td>Horizontal GPS accuracy in meters</td>
  442. <td>10</td>
  443. <td>See notes for <em>lat</em></td>
  444. </tr>
  445. <tr>
  446. <td>speed</td>
  447. <td>xs:decimal</td>
  448. <td>The speed at which the entity is moving, in meters per second</td>
  449. <td>52.69</td>
  450. <td>See notes for <em>alt</em></td>
  451. </tr>
  452. <tr>
  453. <td>references</td>
  454. <td>locationquery:reference</td>
  455. <td>A list of identifiable location references observed by the entity</td>
  456. <td> </td>
  457. <td>Required if no <em>lat</em> and <em>lon</em> values specified, otherwise optional. See Table 2 for type definition.</td>
  458. </tr>
  459. </table>
  460. <table caption='Reference Child Elements'>
  461. <tr>
  462. <th>Element Name</th>
  463. <th>Datatype</th>
  464. <th>Definition</th>
  465. <th>Example</th>
  466. <th>Notes</th>
  467. </tr>
  468. <tr>
  469. <td>id</td>
  470. <td>xs:string</td>
  471. <td>A world-wide unique reference identifier. This SHALL be composed as follows: For cell towers: "MCC:MNC:LAC:CID" where MCC is the mobile country code <note>Values of Mobile Country Codes (MCC) are specified by <link url="">Annex to ITU Operational Bulletin No. 897 – 1.XII.2007</link>.</note>), MNC is the network carrier code, LAC is the area code and CID is the cell ID. For wireless access points and Bluetooth devices: The device MAC address. For IP addresses: the IP address itself (either IPv4 or IPv6).</td>
  472. <td>207:02:12643:78596</td>
  473. <td>Required</td>
  474. </tr>
  475. <tr>
  476. <td>type</td>
  477. <td>xs:string</td>
  478. <td>Reference type as maintained in the registry specified under <link url='#registrar-reftypes'>Reference Types Registry</link></td>
  479. <td>"cell"</td>
  480. <td>Required.</td>
  481. </tr>
  482. <tr>
  483. <td>signalstrength</td>
  484. <td>xs:int</td>
  485. <td>Reference signal strength in dBM. Only appliccable to actively transmitting references (cell towers, wifi access points, Bluetooth devices)</td>
  486. <td>-64</td>
  487. <td>Optional.</td>
  488. </tr>
  489. <tr>
  490. <td>timestamp</td>
  491. <td>xs:datetime</td>
  492. <td>UTC time-stamp (MUST conform to the DateTime profile of &xep0082;). </td>
  493. <td>2004-02-19T21:12Z</td>
  494. <td>Optional. If query contains info from multiple location reference scans, specifying the timestamp for each reference may lead to improved temporal analysis (movement state etc).</td>
  495. </tr>
  496. </table>
  497. <table caption='Location Result Child Elements (Copied from XEP-0080 with notes added)'>
  498. <tr>
  499. <th>Element Name</th>
  500. <th>Datatype</th>
  501. <th>Definition</th>
  502. <th>Example</th>
  503. <th>Notes</th>
  504. </tr>
  505. <tr>
  506. <td>alt</td>
  507. <td>xs:decimal</td>
  508. <td>Altitude in meters above or below sea level</td>
  509. <td>1609</td>
  510. <td>Piped directly through from query <em>alt</em> field if set.</td>
  511. </tr>
  512. <tr>
  513. <td>area</td>
  514. <td>xs:string</td>
  515. <td>A named area such as a campus or neighborhood</td>
  516. <td>Central Park</td>
  517. <td> </td>
  518. </tr>
  519. <tr>
  520. <td>bearing</td>
  521. <td>xs:decimal</td>
  522. <td>GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north</td>
  523. <td> </td>
  524. <td>Piped directly through from query <em>bearing</em> field if set.</td>
  525. </tr>
  526. <tr>
  527. <td>building</td>
  528. <td>xs:string</td>
  529. <td>A specific building on a street or in an area</td>
  530. <td>The Empire State Building</td>
  531. <td> </td>
  532. </tr>
  533. <tr>
  534. <td>country</td>
  535. <td>xs:string</td>
  536. <td>The nation where the user is located</td>
  537. <td>USA</td>
  538. <td> </td>
  539. </tr>
  540. <tr>
  541. <td>datum</td>
  542. <td>xs:string</td>
  543. <td>GPS datum (See notes for XEP-0080)</td>
  544. <td></td>
  545. <td>Piped directly through from query <em>datum</em> field if set.</td>
  546. </tr>
  547. <tr>
  548. <td>description</td>
  549. <td>xs:string</td>
  550. <td>A natural-language name for or description of the location</td>
  551. <td>Bill's house</td>
  552. <td>If location is mapped to a place in a place oriented service, this should hold the place description.</td>
  553. </tr>
  554. <tr>
  555. <td>accuracy</td>
  556. <td>xs:decimal</td>
  557. <td>Horizontal GPS accuracy in meters</td>
  558. <td>10</td>
  559. <td>Piped directly through from query <em>accuracy</em> field or estimated by location server using based on the other information in query and, if possible, differences between several queries over time.</td>
  560. </tr>
  561. <tr>
  562. <td>floor</td>
  563. <td>xs:string</td>
  564. <td>A particular floor in a building</td>
  565. <td>102</td>
  566. <td> </td>
  567. </tr>
  568. <tr>
  569. <td>lat</td>
  570. <td>xs:decimal</td>
  571. <td>Latitude in decimal degrees
  572. North</td>
  573. <td>39.75</td>
  574. <td>Piped directly through from query <em>lat</em> field or estimated by location server based on the other information in query and, if possible, differences between several queries over time.</td>
  575. </tr>
  576. <tr>
  577. <td>locality</td>
  578. <td>xs:string</td>
  579. <td>A locality within the administrative region, such as a town or city</td>
  580. <td>New York City</td>
  581. <td> </td>
  582. </tr>
  583. <tr>
  584. <td>lon</td>
  585. <td>xs:decimal</td>
  586. <td>Longitude in decimal degrees East</td>
  587. <td>-104.99</td>
  588. <td>Piped directly through from query <em>lon</em> or estimated by location server based on the other information in query and, if possible, differences between several queries over time.</td>
  589. </tr>
  590. <tr>
  591. <td>postalcode</td>
  592. <td>xs:string</td>
  593. <td>A code used for postal delivery</td>
  594. <td>10027</td>
  595. <td> </td>
  596. </tr>
  597. <tr>
  598. <td>region</td>
  599. <td>xs:string</td>
  600. <td>An administrative region of the nation, such as a state or province</td>
  601. <td>New York</td>
  602. <td> </td>
  603. </tr>
  604. <tr>
  605. <td>room</td>
  606. <td>xs:string</td>
  607. <td>A particular room in a building</td>
  608. <td>Observatory</td>
  609. <td> </td>
  610. </tr>
  611. <tr>
  612. <td>speed</td>
  613. <td>The speed at which the entity is moving, in meters per second</td>
  614. <td>52.69</td>
  615. <td>xs:decimal</td>
  616. <td>Piped directly through from query <em>speed</em> field or estimated by location server based on the other information in query and, if possible, differences between several queries over time.</td>
  617. </tr>
  618. <tr>
  619. <td>street</td>
  620. <td>xs:string</td>
  621. <td>A thoroughfare within the locality, or a crossing of two thoroughfares</td>
  622. <td>34th and Broadway</td>
  623. <td> </td>
  624. </tr>
  625. <tr>
  626. <td>text</td>
  627. <td>xs:string</td>
  628. <td>A catch-all element that captures any other information about the location</td>
  629. <td>Northwest corner of the lobby</td>
  630. <td>Best practice tip: This field can be used by the server to combine several fields in a natural language style, suitable for simple one-line location presence text. Example: "Near Bob's place" (description + accuracy), "On the road in New York" (locality + speed)</td>
  631. </tr>
  632. <tr>
  633. <td>timestamp</td>
  634. <td>xs:datetime</td>
  635. <td>UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of <cite>XEP-0082</cite>)</td>
  636. <td>2004-02-19T21:12Z</td>
  637. <td>Piped directly through from query <em>timestamp</em> field.</td>
  638. </tr>
  639. <tr>
  640. <td>uri</td>
  641. <td>A URI or URL pointing to
  642. information about the location</td>
  643. <td></td>
  644. <td>xs:anyURI</td>
  645. <td>Only applicable to place-oriented services</td>
  646. </tr>
  647. </table>
  648. <p>NOTE: The datatypes specified above are defined in &w3xmlschema2;.</p>
  649. </section1>
  650. <section1 topic='Recommended Transport' anchor='transport'>
  651. <p>The location results SHOULD be distributed means of &xep0060; or the subset thereof specified in &xep0163;. This can be done automatically by requesting the "publish" location query result format, in which case the location server will publish the results on the user's behalf. Alternatively the it can be done client side as outlined in <cite>XEP-0080</cite>.</p>
  652. </section1>
  653. <section1 topic='Implementation Notes' anchor='impl'>
  654. <section2 topic='Server Implementation Notes' anchor='server_impl'>
  655. <p>The does not have to determine a value for all fields of the &lt;geoloc&gt; stanza, but it SHOULD determine values for as many as possible. At the very least a value for 'country' should be set.</p>
  656. <p>If no GPS coordinate and accuracy information is submitted in the query, and the server determines location coordinates from submitted reference data, a value for the returned geoloc 'accuracy' field SHOULD be returned. The magnitude of this should be derived based on the ranges of the location references used to determine the location, if known. </p>
  657. <p>The server should make no assumptions about how often a entity submits a query. It should support occasional manually triggered queries as well as periodic automated queries. In the latter case it should analyze changes over time, as this can greatly increase the fidelity of the result. </p>
  658. <p>Furthermore, no assumptions should be made about the number and types of location references being logged in each query. Some handset manufacturers limit the access programmers have to cell tower and access point information. Some may only offer the currently connected cell ID, such that even if the handset can "see" many cell towers, only the one to which the handset is connected at the moment can be read. In this case the cell tower readings may not be constant, even if the querying entity is not moving. Rather it may jump round-robin style to each visible cell with variable time spent on each. The location server should account for this to avoid yielding results indicating that a user is running around in cell-sized circles when he is in fact stationary. Again, analysis of variation of submitted queries over time is recommended.</p>
  659. <p>As no guarantees can be made that a given location reference stays at one fixed physical location throughout it's lifetime, the server should implement means to detect this. Generally it can be assumed that cell towers seldom move (could happen when a network operator changes the way it allocates cell IDs or when a tower is physically moved to a different location). Wireless access points move a bit more frequently (for instance when their owners move, or if they are installed in moving vehicles such as busses or trains). Bluetooth devices can generally be assumed to be mobile and should, unless specific knowledge to the contrary exists, not be used to locate an entity to a specific physical location. Rather, Bluetooth devices (and other mobile references) can be used to co-locate entities to other entities for which a physical location is known. An example: Entity A submits query with GPS coordinates and the ID of some Bluetooth device. It is located based on its submitted coordinates. Entity B submits a query with the same Bluetooth device ID, but no GPS coordinates. Given this, and the fact that Bluetooth transmitters have a very limited range, the server can then derive that A and B are at the same physical location (it may add 10-20 m to the accuracy of the location of B to account for the Bluetooth range).</p>
  660. <p>The "radio landscape" is by no means constant. New cells and access points are added continuously, and old ones are phased out. A location server will have to adapt to this shifting landscape, either by means of operator-supplied databases (in case of cell towers) or by means of user generated information. This standard was written with the latter in mind, and it is recommended that location servers utilize any queries with both GPS coordinates and location references to "learn" the approximate physical location of the provided references. For server implementation that rely on user generated information only, it is also recommended to supply additional means for the users to feed back location context in cases where the client does not have any GPS access, or when the server produces the wrong results. One way to do this would be to let the users define "placemarks" (a name, street, city etc) that can be associated with the references seen by this user at the time of definition. This is however beyond the scope of this XEP. </p>
  661. </section2>
  662. <section2 topic='Client Implementation Notes' anchor='client_impl'>
  663. <p>For the reasons mentioned above, it is recommended that the client supply both GPS coordinates as well as nearby location references when possible. Also it is recommended that the client submit queries frequently enough to allow the server to analyze changes over time (or lack thereof) to obtain a better result. When possible, the client should include wifi access points in the queries, as these yield much more precise results than cell towers alone (due to the much more limited range). This must however all be weighted against the increased power consumption resulting from keeping network sockets open, scanning for access points and driving a GPS receiver. For optimal results, clients SHOULD post a location query any time when the set of observed location references change (e.g. a new cell tower is seen or an old one is not seen any more)</p>
  664. </section2>
  665. </section1>
  666. <section1 topic='Internationalization Considerations' anchor='i18n'>
  667. <p>Because the character data contained in the location results is intended to be readable by humans, the location query SHOULD possess an 'xml:lang' attribute specifying the natural language of such character data &rfc4646;. If so, the server SHOULD equip the &lt;geoloc/&gt; element, of the result stanza with an identical attribute </p>
  668. </section1>
  669. <section1 topic='Security Considerations' anchor='security'>
  670. <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 &lt;accuracy/&gt; element SHOULD NOT be included.</p>
  671. </section1>
  672. <section1 topic='IANA Considerations' anchor='iana'>
  673. <p>This document requires no interaction with the &IANA;.</p>
  674. </section1>
  675. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  676. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  677. <p>This specification defines the following XML namespace:</p>
  678. <ul>
  679. <li>urn:xmpp:locationquery:0</li>
  680. </ul>
  681. <p>Upon advancement of this specification from a status of Experimental to a status of Draft, the &REGISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
  682. </section2>
  683. <section2 topic='Protocol Versioning' anchor='registrar-versioning'>
  684. &NSVER;
  685. </section2>
  686. <section2 topic='Reference Types Registry' anchor='registrar-reftypes'>
  687. <section3 topic='Process' anchor='registrar-reftypes-process'>
  688. <p>The XMPP Registrar shall maintain a registry of values for the &lt;type/&gt; child of the &lt;reference/&gt; element when qualified by the 'urn:xmpp:locationquery:0' namespace.</p>
  690. <code><![CDATA[
  691. <reftype>
  692. <name>the machine-readable name for the reference type</name>
  693. <description>a natural-language description of the reference type</description>
  694. </reftype>
  695. ]]></code>
  696. <p>The registrant can register more than one reference type at a time, each contained in a separate &lt;reftype/&gt; element.</p>
  697. </section3>
  698. <section3 topic='Initial Submission' anchor='registrar-reftypes-init'>
  699. <p>As part of this document, the following reference types are registered:</p>
  700. <code><![CDATA[
  701. <reftype>
  702. <name>bluetooth</name>
  703. <description>
  704. The device address as determined by Bluetooth technologies as defined in
  705. the IEEE 802.15.1 standards.
  706. </description>
  707. </reftype>
  708. <reftype>
  709. <name>cell</name>
  710. <description>
  711. A cell tower address, formatted as "MCC:MNC:LAC:CID" (where MCC is
  712. the mobile country code, MNC is the network carrier code, LAC is the
  713. area code, and CID is the cell ID).
  714. </description>
  715. </reftype>
  716. <reftype>
  717. <name>ip</name>
  718. <description>
  719. An Internet Protocol (IP) address possessed by or assigned to the
  720. client.
  721. </description>
  722. </reftype>
  723. <reftype>
  724. <name>nic</name>
  725. <description>
  726. The link layer (Media Access Control) address of one of the Network
  727. Interface Controllers (NICs) associated with the client sending the
  728. request. Most commonly, this will take the form of a 48-bit Ethernet
  729. address formatted in six colon-separated groups of two hexadecimal
  730. digits, in transmission order. Some location servers might be able to
  731. use this information to query network elements through which the client
  732. is connected to deduce location data.
  733. </description>
  734. </reftype>
  735. <reftype>
  736. <name>rfid</name>
  737. <description>
  738. The device address as determined by Radio Frequency Identification
  739. technologies.
  740. </description>
  741. </reftype>
  742. <reftype>
  743. <name>wifi</name>
  744. <description>
  745. The device address as determined by WiFi technologies as defined in
  746. the IEEE 802.11 standards.
  747. </description>
  748. </reftype>
  749. <reftype>
  750. <name>wimax</name>
  751. <description>
  752. The device address as determined by Worldwide Inter-operability for
  753. Microwave Access technologies.
  754. </description>
  755. </reftype>
  756. ]]></code>
  757. </section3>
  758. </section2>
  759. </section1>
  760. <section1 topic='XML Schema' anchor='schema'>
  761. <code><![CDATA[
  762. <xs:schema
  763. xmlns:xs=''
  764. targetNamespace='urn:xmpp:locationquery:0'
  765. xmlns='urn:xmpp:locationquery:0'
  766. elementFormDefault='qualified'>
  767. <xs:element name='locationquery'>
  768. <xs:complexType>
  769. <xs:sequence minOccurs='1' maxOccurs='1'>
  770. <xs:element name='timestamp'
  771. minOccurs='0'
  772. maxOccurs='1'
  773. type='xs:datetime'/>
  774. <xs:element name='publish'
  775. minOccurs='0'
  776. maxOccurs='1'
  777. type='xs:bolean'/>
  778. <xs:element name='lat'
  779. minOccurs='0'
  780. maxOccurs='1'
  781. type='xs:decimal'/>
  782. <xs:element name='lon'
  783. minOccurs='0'
  784. maxOccurs='1'
  785. type='xs:decimal'/>
  786. <xs:element name='alt'
  787. minOccurs='0'
  788. maxOccurs='1'
  789. type='xs:decimal'/>
  790. <xs:element name='bearing'
  791. minOccurs='0'
  792. maxOccurs='1'
  793. type='xs:decimal'/>
  794. <xs:element name='speed'
  795. minOccurs='0'
  796. maxOccurs='1'
  797. type='xs:decimal'/>
  798. <xs:element name='datum'
  799. minOccurs='0'
  800. maxOccurs='1'
  801. type='xs:string'/>
  802. <xs:element name='accuracy'
  803. minOccurs='0'
  804. maxOccurs='1'
  805. type='xs:decimal'/>
  806. <xs:element name='references'
  807. minOccurs='0'
  808. maxOccurs='unbounded'
  809. type='referenceType'/>
  810. </xs:sequence>
  811. </xs:complexType>
  812. </xs:element>
  813. <xs:complexType name='referenceType'>
  814. <xs:sequence minOccurs='1' maxOccurs='1'>
  815. <xs:element name='id'
  816. minOccurs='1'
  817. maxOccurs='1'
  818. type='xs:string'/>
  819. <xs:element name='type'
  820. minOccurs='1'
  821. maxOccurs='1'
  822. type='xs:string'/>
  823. <xs:element name='signalstrength'
  824. minOccurs='0'
  825. maxOccurs='1'
  826. type='xs:int'/>
  827. <xs:element name='timestamp'
  828. minOccurs='0'
  829. maxOccurs='1'
  830. type='xs:datetime'/>
  831. </xs:sequence>
  832. </xs:complexType>
  833. </xs:schema>
  834. ]]></code>
  835. <p>Note: the schema for the location results is given by <cite>XEP-0080</cite>.</p>
  836. </section1>
  837. </xep>