-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep-0255.xml
912 lines (843 loc) · 39 KB
/
xep-0255.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Location Query</title>
<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>
&LEGALNOTICE;
<number>0255</number>
<status>Deferred</status>
<type>Standards Track</type>
<sig>Standards</sig>
<approver>Council</approver>
<dependencies>
<spec>XMPP Core</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>NOT_YET_ASSIGNED</shortname>
<author>
<firstname>Helge</firstname>
<surname>Timenes</surname>
<email>helge@buddycloud.com</email>
<jid>helge@buddycloud.com</jid>
</author>
<author>
<firstname>Simon</firstname>
<surname>Tennant</surname>
<email>simon@buddycloud.com</email>
<jid>simon@buddycloud.com</jid>
</author>
<author>
<firstname>Ross</firstname>
<surname>Savage</surname>
<email>ross@buddycloud.com</email>
<jid>ross@buddycloud.com</jid>
</author>
<revision>
<version>0.6.1</version>
<date>2018-11-03</date>
<initials>pep</initials>
<remark>Fix a bunch of typos, batch-style.</remark>
</revision>
<revision>
<version>0.6</version>
<date>2009-04-09</date>
<initials>psa</initials>
<remark><p>Defined registry; added nic type from list discussion.</p></remark>
</revision>
<revision>
<version>0.5</version>
<date>2009-03-13</date>
<initials>ht</initials>
<remark>
<ul>
<li>Added example with IP address</li>
<li>Corrected closing </iq> tags in examples</li>
</ul>
</remark>
</revision>
<revision>
<version>0.4</version>
<date>2009-02-17</date>
<initials>ht</initials>
<remark>
<ul>
<li>Added IP address to the type of beacons</li>
<li>Changed the nomenclature from 'beacons' to 'references' as they may not always be active transmitters (as in the case of IP address)</li>
<li>Corrected <latitude/> and <longitude/> and tags in example 1 to <lat/> and <lon/></li>
</ul>
</remark>
</revision>
<revision>
<version>0.3</version>
<date>2008-12-20</date>
<initials>ht</initials>
<remark>
<ul>
<li>Corrected name-space in section 10.1.</li>
<li>Removed extra 's in example 7 </li>
<li>Made time-stamp optional</li>
<li>Added optional time-stamp to beacon element</li>
<li>Added comment reflecting that query time-stamp applies to GPS coordinates if beacons provide own time-stamps</li>
<li>Updated schema to reflect changes.</li>
</ul>
</remark>
</revision>
<revision>
<version>0.2</version>
<date>2008-12-17</date>
<initials>ht</initials>
<remark>
<ul>
<li>Updated examples to be conform with XEP-0080 (use lat and lon instead of latitude and longitude).</li>
<li>Fixed wrong closing tag for <type> in examples.</li>
<li>Added signal strength to beacon data.</li>
</ul>
</remark>
</revision>
<revision>
<version>0.1</version>
<date>2008-11-13</date>
<initials>psa</initials>
<remark><p>Initial published version.</p></remark>
</revision>
<revision>
<version>0.0.3</version>
<date>2008-11-07</date>
<initials>ht</initials>
<remark>
<ul>
<li>Removed <error/> child of geoloc element (arc minutes).</li>
<li>Added <accuracy/> (meters).</li>
<li>Updated notes on GPS data submitted in location query.</li>
<li>Replaced language encoding 'en-UK' with 'en-US' to avoid UK/GB confusion.</li>
</ul>
</remark>
</revision>
<revision>
<version>0.0.2</version>
<date>2008-11-03</date>
<initials>ht</initials>
<remark>
<ul>
<li>Corrected XML namespace.</li>
<li>Added country code reference.</li>
</ul>
</remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2008-10-28</date>
<initials>ht/st/rs</initials>
<remark><p>First draft.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<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>
<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>
</section1>
<section1 topic='Requirements' anchor='reqs'>
<p>The format defined herein was designed to address the following requirements:</p>
<ul>
<li>It shall be usable on devices with no support for GPS or other geodetic positioning systems</li>
<li>It shall be usable on devices with support for GPS or other geodetic positioning systems</li>
<li>It shall be compatible with place-referencing systems</li>
<li>It shall support self-learning location servers</li>
<li>The result format shall be expressed as natural language location description</li>
<li>The result format shall be compatible with XEP-0080</li>
</ul>
</section1>
<section1 topic='How It Works' anchor='examples'>
<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 <locationquery/> 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>
<example caption='Entity queries server with GPS coordinates'><![CDATA[
<iq from='hamlet@shakespeare.lit/phone'
id='q01'
to='location.shakespear.lit'
type='get'
xml:lang='en-US'>
<locationquery xmlns='urn:xmpp:locationquery:0'>
<lat>57.0501862</lat>
<lon>9.9188746</lon>
<accuracy>35.6</accuracy>
</locationquery>
</iq>
]]></example>
<example caption='Server responds with location info'><![CDATA[
<iq from='location.shakespeare.lit'
id='q01'
to='hamlet@shakespeare.lit/phone'
type='result'
xml:lang='en-US'>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<timestamp>1599-10-23T01:56:05Z</timestamp>
<lat>57.0501862</lat>
<lon>9.9188746</lon>
<accuracy>35.6</accuracy>
<street>Jomfru Ane Gade 13</street>
<locality>Aalborg</locality>
<country>Denmark</country>
<uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
<text>Near King's Head Pub</text>
</geoloc>
</iq>
]]></example>
<example caption='Entity queries server with IP address'><![CDATA[
<iq from='hamlet@shakespeare.lit/phone'
id='q02'
to='location.shakespear.lit'
type='get'
xml:lang='en-US'>
<locationquery xmlns='urn:xmpp:locationquery:0'>
<reference>
<id>80.2.47.198</id>
<type>ip</type>
</reference>
</locationquery>
</iq>
]]></example>
<example caption='Server responds with location info'><![CDATA[
<iq from='location.shakespeare.lit'
id='q02'
to='hamlet@shakespeare.lit/phone'
type='result'
xml:lang='en-US'>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<timestamp>1599-10-23T01:56:05Z</timestamp>
<lat>56.8</lat>
<lon>9.9</lon>
<accuracy>100000</accuracy>
<locality>Aalborg</locality>
<country>Denmark</country>
</geoloc>
</iq>
]]></example>
<example caption='Entity queries server with cell tower and wifi access point IDs'><![CDATA[
<iq from='hamlet@shakespeare.lit/phone'
id='q03'
to='location.shakespear.lit'
type='get'
xml:lang='en-US'>
<locationquery xmlns='urn:xmpp:locationquery:0'>
<reference>
<id>238:02:34775:50880</id>
<type>cell</type>
</reference>
<reference>
<id>00:0F:3D:42:92:2A</id>
<type>wifi</type>
</reference>
<reference>
<id>00:19:CB:45:50:4A</id>
<type>wifi</type>
</reference>
</locationquery>
</iq>
]]></example>
<example caption='Server responds with location info'><![CDATA[
<iq from='location.shakespeare.lit'
id='q03'
to='hamlet@shakespeare.lit/phone'
type='result'
xml:lang='en-US'>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<timestamp>1599-10-23T01:56:05Z</timestamp>
<lat>57.050122</lat>
<lon>9.918833</lon>
<locality>Aalborg</locality>
<street>Jomfru Ane Gade 13</street>
<country>Denmark</country>
<accuracy>20</accuracy>
<uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
<text>King's Head Pub</text>
</geoloc>
</iq>
]]></example>
<example caption='Entity queries server with reference info from multiple cell tower and wifi accespoint scans and specifies that results should be published'><![CDATA[
<iq from='hamlet@shakespeare.lit/phone'
id='q04'
to='location.shakespear.lit'
type='get'
xml:lang='en-US'>
<locationquery xmlns='urn:xmpp:locationquery:0'>
<timestamp>1599-10-23T01:55:21Z</timestamp>
<lat>57.0501862</lat>
<lon>9.918874</lon>
<accuracy>33.56</accuracy>
<publish>true</publish>
<reference>
<id>238:02:34775:50880</id>
<type>cell</type>
<signalstrength>-88</signalstrength>
<timestamp>1599-10-23T01:55:21Z</timestamp>
</reference>
<reference>
<id>238:02:34775:48770</id>
<type>cell</type>
<signalstrength>-76</signalstrength>
<timestamp>1599-10-23T01:52:34Z</timestamp>
</reference>
<reference>
<id>00:0F:3D:42:92:2A</id>
<type>wifi</type>
<signalstrength>-64</signalstrength>
<timestamp>1599-10-23T01:55:21Z</timestamp>
</reference>
<reference>
<id>238:02:34775:50880</id>
<type>cell</type>
<signalstrength>-88</signalstrength>
<timestamp>1599-10-23T01:55:21Z</timestamp>
</reference>
<reference>
<id>00:19:CB:45:50:4A</id>
<type>wifi</type>
<signalstrength>-82</signalstrength>
<timestamp>1599-10-23T01:52:24Z</timestamp>
</reference>
<reference>
<id>00:18:42:E6:71:51</id>
<type>bluetooth</type>
</reference>
</locationquery>
</iq>
]]></example>
<example caption='Server responds with empty IQ-result...'><![CDATA[
<iq from='location.shakespeare.lit'
id='q04'
to='hamlet@shakespeare.lit/phone'
type='result'
xml:lang='en-US' />
]]></example>
<example caption='...and publishes result to the entity's geoloc pubsub node...'><![CDATA[
<iq from='hamlet@shakespeare.lit/phone'
id='q04'
to='hamlet@shakespeare.lit/phone'
type='set'
xml:lang='en-US'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish>
<node xmlns='http://jabber.org/protocol/geoloc'>
<item>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<timestamp>1599-10-23T01:56:05Z</timestamp>
<lat>57.0501862</lat>
<lon>9.918874</lon>
<street>Jomfru Ane Gade 13</street>
<locality>Aalborg</locality>
<country>Denmark</country>
<accuracy>20</accuracy>
<uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
<text>King's Head Pub</text>
</geoloc>
</item>
</node>
</publish>
</pubsub>
</iq>
]]></example>
<example caption='...which is delivered to everyone subscribing to it'><![CDATA[
<message from='hamlet@shakespeare.lit' to='hamlet@shakespeare.lit/phone'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/geoloc'>
<item id='4C940F61C13A0'>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<timestamp>1599-10-23T01:56:05Z</timestamp>
<lat>57.0501862</lat>
<lon>9.918874</lon>
<street>Jomfru Ane Gade 13</street>
<locality>Aalborg</locality>
<country>Denmark</country>
<accuracy>20</accuracy>
<uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
<text>King's Head Pub</text>
</geoloc>
</item>
</items>
</event>
</message>
<message from='hamlet@shakespeare.lit' to='horatio@shakespeare.lit/pda'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/geoloc'>
<item id='4C940F61C13A0'>
<geoloc xmlns='http://jabber.org/protocol/geoloc' xml:lang='en'>
<timestamp>1599-10-23T01:56:05Z</timestamp>
<lat>57.0501862</lat>
<lon>9.918874</lon>
<street>Jomfru Ane Gade 13</street>
<locality>Aalborg</locality>
<country>Denmark</country>
<accuracy>20</accuracy>
<uri>http://shakespeare.lit/places/kings_head_pub_aalborg</uri>
<text>King's Head Pub</text>
</geoloc>
</item>
</items>
</event>
</message>
]]></example>
</section1>
<section1 topic='Data Format' anchor='format'>
<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 <locationquery/> element that is qualified by the 'urn:xmpp:locationquery:0' namespace and nested with in a <iq> element with type set to <em>get</em>. The location result is provided by the location server and returned to the client in a <iq> element with type set to <em>result</em>. The location result is structured by means of a <geoloc/> element that is qualified by the 'http://jabber.org/protocol/geoloc' namespace (see <link url="xep-0080.html">XEP-0080</link>).</p>
<table caption='Location Query Child Elements'>
<tr>
<th>Element Name</th>
<th>Datatype</th>
<th>Definition</th>
<th>Example</th>
<th>Notes</th>
</tr>
<tr>
<td>timestamp</td>
<td>xs:datetime</td>
<td>UTC time-stamp (MUST conform to the DateTime profile of &xep0082;). </td>
<td>2004-02-19T21:12Z</td>
<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>
</tr>
<tr>
<td>publish</td>
<td>xs:boolean</td>
<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>
<td>true</td>
<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 <iq> 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 <iq> with type set to "result". Default is "false"</td>
</tr>
<tr>
<td>lat</td>
<td>xs:decimal</td>
<td>Latitude in decimal degrees
North.</td>
<td>39.75</td>
<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>
</tr>
<tr>
<td>lon</td>
<td>xs:decimal</td>
<td>Longitude in decimal degrees East</td>
<td>-104.99</td>
<td>See notes for <em>lat</em></td>
</tr>
<tr>
<td>alt</td>
<td>xs:decimal</td>
<td>Altitude in meters above or below sea level</td>
<td>1609</td>
<td>Optional. If present, this shall also be present in the result stanza with identical value.</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</td>
<td> </td>
<td>See notes for <em>alt</em></td>
</tr>
<tr>
<td>datum</td>
<td>xs:string</td>
<td>GPS datum (See XEP-0080)</td>
<td> </td>
<td>See notes for <em>alt</em></td>
</tr>
<tr>
<td>accuracy</td>
<td>xs:decimal</td>
<td>Horizontal GPS accuracy in meters</td>
<td>10</td>
<td>See notes for <em>lat</em></td>
</tr>
<tr>
<td>speed</td>
<td>xs:decimal</td>
<td>The speed at which the entity is moving, in meters per second</td>
<td>52.69</td>
<td>See notes for <em>alt</em></td>
</tr>
<tr>
<td>references</td>
<td>locationquery:reference</td>
<td>A list of identifiable location references observed by the entity</td>
<td> </td>
<td>Required if no <em>lat</em> and <em>lon</em> values specified, otherwise optional. See Table 2 for type definition.</td>
</tr>
</table>
<table caption='Reference Child Elements'>
<tr>
<th>Element Name</th>
<th>Datatype</th>
<th>Definition</th>
<th>Example</th>
<th>Notes</th>
</tr>
<tr>
<td>id</td>
<td>xs:string</td>
<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="http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.212A-2007-PDF-E.pdf">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>
<td>207:02:12643:78596</td>
<td>Required</td>
</tr>
<tr>
<td>type</td>
<td>xs:string</td>
<td>Reference type as maintained in the registry specified under <link url='#registrar-reftypes'>Reference Types Registry</link></td>
<td>"cell"</td>
<td>Required.</td>
</tr>
<tr>
<td>signalstrength</td>
<td>xs:int</td>
<td>Reference signal strength in dBM. Only appliccable to actively transmitting references (cell towers, wifi access points, Bluetooth devices)</td>
<td>-64</td>
<td>Optional.</td>
</tr>
<tr>
<td>timestamp</td>
<td>xs:datetime</td>
<td>UTC time-stamp (MUST conform to the DateTime profile of &xep0082;). </td>
<td>2004-02-19T21:12Z</td>
<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>
</tr>
</table>
<table caption='Location Result Child Elements (Copied from XEP-0080 with notes added)'>
<tr>
<th>Element Name</th>
<th>Datatype</th>
<th>Definition</th>
<th>Example</th>
<th>Notes</th>
</tr>
<tr>
<td>alt</td>
<td>xs:decimal</td>
<td>Altitude in meters above or below sea level</td>
<td>1609</td>
<td>Piped directly through from query <em>alt</em> field if set.</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>
<td> </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</td>
<td> </td>
<td>Piped directly through from query <em>bearing</em> field if set.</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>
<td> </td>
</tr>
<tr>
<td>country</td>
<td>xs:string</td>
<td>The nation where the user is located</td>
<td>USA</td>
<td> </td>
</tr>
<tr>
<td>datum</td>
<td>xs:string</td>
<td>GPS datum (See notes for XEP-0080)</td>
<td></td>
<td>Piped directly through from query <em>datum</em> field if set.</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>
<td>If location is mapped to a place in a place oriented service, this should hold the place description.</td>
</tr>
<tr>
<td>accuracy</td>
<td>xs:decimal</td>
<td>Horizontal GPS accuracy in meters</td>
<td>10</td>
<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>
</tr>
<tr>
<td>floor</td>
<td>xs:string</td>
<td>A particular floor in a building</td>
<td>102</td>
<td> </td>
</tr>
<tr>
<td>lat</td>
<td>xs:decimal</td>
<td>Latitude in decimal degrees
North</td>
<td>39.75</td>
<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>
</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>
<td> </td>
</tr>
<tr>
<td>lon</td>
<td>xs:decimal</td>
<td>Longitude in decimal degrees East</td>
<td>-104.99</td>
<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>
</tr>
<tr>
<td>postalcode</td>
<td>xs:string</td>
<td>A code used for postal delivery</td>
<td>10027</td>
<td> </td>
</tr>
<tr>
<td>region</td>
<td>xs:string</td>
<td>An administrative region of the nation, such as a state or province</td>
<td>New York</td>
<td> </td>
</tr>
<tr>
<td>room</td>
<td>xs:string</td>
<td>A particular room in a building</td>
<td>Observatory</td>
<td> </td>
</tr>
<tr>
<td>speed</td>
<td>The speed at which the entity is moving, in meters per second</td>
<td>52.69</td>
<td>xs:decimal</td>
<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>
</tr>
<tr>
<td>street</td>
<td>xs:string</td>
<td>A thoroughfare within the locality, or a crossing of two thoroughfares</td>
<td>34th and Broadway</td>
<td> </td>
</tr>
<tr>
<td>text</td>
<td>xs:string</td>
<td>A catch-all element that captures any other information about the location</td>
<td>Northwest corner of the lobby</td>
<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>
</tr>
<tr>
<td>timestamp</td>
<td>xs:datetime</td>
<td>UTC timestamp specifying the moment when the reading was taken (MUST conform to the DateTime profile of <cite>XEP-0082</cite>)</td>
<td>2004-02-19T21:12Z</td>
<td>Piped directly through from query <em>timestamp</em> field.</td>
</tr>
<tr>
<td>uri</td>
<td>A URI or URL pointing to
information about the location</td>
<td>http://beta.plazes.com/plazes/1940:jabber_inc</td>
<td>xs:anyURI</td>
<td>Only applicable to place-oriented services</td>
</tr>
</table>
<p>NOTE: The datatypes specified above are defined in &w3xmlschema2;.</p>
</section1>
<section1 topic='Recommended Transport' anchor='transport'>
<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>
</section1>
<section1 topic='Implementation Notes' anchor='impl'>
<section2 topic='Server Implementation Notes' anchor='server_impl'>
<p>The does not have to determine a value for all fields of the <geoloc> stanza, but it SHOULD determine values for as many as possible. At the very least a value for 'country' should be set.</p>
<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>
<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>
<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>
<p>As no guarantees can be made that a given location reference stays at one fixed physical location throughout its 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>
<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>
</section2>
<section2 topic='Client Implementation Notes' anchor='client_impl'>
<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>
</section2>
</section1>
<section1 topic='Internationalization Considerations' anchor='i18n'>
<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 <geoloc/> element, of the result stanza with an identical attribute </p>
</section1>
<section1 topic='Security Considerations' anchor='security'>
<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 <accuracy/> element SHOULD NOT be included.</p>
</section1>
<section1 topic='IANA Considerations' anchor='iana'>
<p>This document requires no interaction with the &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>This specification defines the following XML namespace:</p>
<ul>
<li>urn:xmpp:locationquery:0</li>
</ul>
<p>Upon advancement of this specification from a status of Experimental to a status of Draft, the ®ISTRAR; shall add the foregoing namespaces to the registry located at &NAMESPACES;, as described in Section 4 of &xep0053;.</p>
</section2>
<section2 topic='Protocol Versioning' anchor='registrar-versioning'>
&NSVER;
</section2>
<section2 topic='Reference Types Registry' anchor='registrar-reftypes'>
<section3 topic='Process' anchor='registrar-reftypes-process'>
<p>The XMPP Registrar shall maintain a registry of values for the <type/> child of the <reference/> element when qualified by the 'urn:xmpp:locationquery:0' namespace.</p>
®PROCESS;
<code><![CDATA[
<reftype>
<name>the machine-readable name for the reference type</name>
<description>a natural-language description of the reference type</description>
</reftype>
]]></code>
<p>The registrant can register more than one reference type at a time, each contained in a separate <reftype/> element.</p>
</section3>
<section3 topic='Initial Submission' anchor='registrar-reftypes-init'>
<p>As part of this document, the following reference types are registered:</p>
<code><![CDATA[
<reftype>
<name>bluetooth</name>
<description>
The device address as determined by Bluetooth technologies as defined in
the IEEE 802.15.1 standards.
</description>
</reftype>
<reftype>
<name>cell</name>
<description>
A cell tower address, formatted as "MCC:MNC:LAC:CID" (where MCC is
the mobile country code, MNC is the network carrier code, LAC is the
area code, and CID is the cell ID).
</description>
</reftype>
<reftype>
<name>ip</name>
<description>
An Internet Protocol (IP) address possessed by or assigned to the
client.
</description>
</reftype>
<reftype>
<name>nic</name>
<description>
The link layer (Media Access Control) address of one of the Network
Interface Controllers (NICs) associated with the client sending the
request. Most commonly, this will take the form of a 48-bit Ethernet
address formatted in six colon-separated groups of two hexadecimal
digits, in transmission order. Some location servers might be able to
use this information to query network elements through which the client
is connected to deduce location data.
</description>
</reftype>
<reftype>
<name>rfid</name>
<description>
The device address as determined by Radio Frequency Identification
technologies.
</description>
</reftype>
<reftype>
<name>wifi</name>
<description>
The device address as determined by WiFi technologies as defined in
the IEEE 802.11 standards.
</description>
</reftype>
<reftype>
<name>wimax</name>
<description>
The device address as determined by Worldwide Inter-operability for
Microwave Access technologies.
</description>
</reftype>
]]></code>
</section3>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<code><![CDATA[
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='urn:xmpp:locationquery:0'
xmlns='urn:xmpp:locationquery:0'
elementFormDefault='qualified'>
<xs:element name='locationquery'>
<xs:complexType>
<xs:sequence minOccurs='1' maxOccurs='1'>
<xs:element name='timestamp'
minOccurs='0'
maxOccurs='1'
type='xs:datetime'/>
<xs:element name='publish'
minOccurs='0'
maxOccurs='1'
type='xs:bolean'/>
<xs:element name='lat'
minOccurs='0'
maxOccurs='1'
type='xs:decimal'/>
<xs:element name='lon'
minOccurs='0'
maxOccurs='1'
type='xs:decimal'/>
<xs:element name='alt'
minOccurs='0'
maxOccurs='1'
type='xs:decimal'/>
<xs:element name='bearing'
minOccurs='0'
maxOccurs='1'
type='xs:decimal'/>
<xs:element name='speed'
minOccurs='0'
maxOccurs='1'
type='xs:decimal'/>
<xs:element name='datum'
minOccurs='0'
maxOccurs='1'
type='xs:string'/>
<xs:element name='accuracy'
minOccurs='0'
maxOccurs='1'
type='xs:decimal'/>
<xs:element name='references'
minOccurs='0'
maxOccurs='unbounded'
type='referenceType'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name='referenceType'>
<xs:sequence minOccurs='1' maxOccurs='1'>
<xs:element name='id'
minOccurs='1'
maxOccurs='1'
type='xs:string'/>
<xs:element name='type'
minOccurs='1'
maxOccurs='1'
type='xs:string'/>
<xs:element name='signalstrength'
minOccurs='0'
maxOccurs='1'
type='xs:int'/>
<xs:element name='timestamp'
minOccurs='0'
maxOccurs='1'
type='xs:datetime'/>
</xs:sequence>
</xs:complexType>
</xs:schema>
]]></code>
<p>Note: the schema for the location results is given by <cite>XEP-0080</cite>.</p>
</section1>
</xep>