forked from opening-hours/opening_hours.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
executable file
·5869 lines (5409 loc) · 358 KB
/
test.js
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
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env nodejs
// preamble {{{
/* Parameter handling {{{ */
var optimist = require('optimist')
.usage('Usage: $0 [optional parameters]')
.describe('h', 'Display the usage')
// .describe('v', 'Verbose output')
.describe('f', 'File path to the opening_hours.js libary file to run the tests against.')
.describe('l', 'Locale for error/warning messages and prettified values.')
.alias('h', 'help')
// .alias('v', 'verbose')
.alias('f', 'library-file')
.alias('l', 'locale')
.default('f', './opening_hours.js')
.default('l', 'en');
var argv = optimist.argv;
if (argv.help) {
optimist.showHelp();
process.exit(0);
}
/* }}} */
/* Required modules {{{ */
var opening_hours = require('./' + argv['library-file']);
var colors = require('colors');
var sprintf = require('sprintf-js').sprintf;
var timekeeper = require('timekeeper');
/* }}} */
colors.setTheme({
passed: [ 'green' , 'bold' ] , // printed with console.log
warn: [ 'blue' , 'bold' ] , // printed with console.info
failed: [ 'red' , 'bold' ] , // printed with console.warn
crashed: [ 'magenta', 'bold' ] , // printed with console.error
ignored: [ 'yellow' , 'bold' ] ,
});
/* Fake time to make "The year is in the past." test deterministic. */
timekeeper.travel(new Date('Sat May 23 2015 23:23:23 GMT+0200 (CEST)')); // Travel to that date.
var test = new opening_hours_test();
// test.extensive_testing = true;
// FIXME: Do it.
// nominatimJSON {{{
var nominatim_for_loc = require('./js/nominatim_definitions.js').for_loc;
/* Used for sunrise, sunset … and PH,SH.
* Do not define new nominatim responses below and instead define them in
* ./js/nominatim_definitions.js
*/
/* Defaults {{{ */
// https://nominatim.openstreetmap.org/reverse?format=json&lat=49.5487429714954&lon=9.81602098644987&zoom=18&addressdetails=1
var nominatimTestJSON = {"place_id":"44651229","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"36248375","lat":"49.5400039","lon":"9.7937133","display_name":"K 2847, Lauda-K\u00f6nigshofen, Main-Tauber-Kreis, Regierungsbezirk Stuttgart, Baden-W\u00fcrttemberg, Germany, European Union","address":{"road":"K 2847","city":"Lauda-K\u00f6nigshofen","county":"Main-Tauber-Kreis","state_district":"Regierungsbezirk Stuttgart","state":"Baden-W\u00fcrttemberg","country":"Germany","country_code":"de","continent":"European Union"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=60.5487429714954&lon=9.81602098644987&zoom=18&addressdetails=1
var nominatimTestJSON_sunrise_below_default = {"place_id":"71977948","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"118145917","lat":"60.5467949","lon":"9.8269589","display_name":"243, Ringerike, Buskerud, Norway","address":{"road":"243","county":"Ringerike","state":"Buskerud","country":"Norway","country_code":"no"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=27.567&lon=-71.093&zoom=18&addressdetails=1
// Actual response: {"error":"Unable to geocode"}
var nominatim_no_valid_address = {
"place_id": "-966",
"licence": "Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
"osm_type": "way",
"osm_id": "-42",
"lat": "27.567",
"lon": "-71.093",
"display_name": "-23, None, None, None",
"address": {
"road": "-23",
"county": "None",
"state": "None",
"country": "None",
"country_code": "none"
}
};
/* }}} */
/* Russia {{{ */
// https://nominatim.openstreetmap.org/reverse?format=json&lat=59.9179&lon=30.3058&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_sanktpeterburg = {
"address": {
"city": "Saint Petersburg",
"country": "Russian Federation",
"country_code": "ru",
"house_number": "126",
"postcode": "190000",
"road": "Fontanka River Embankment",
"state": "Saint Petersburg",
"state_district": "\u0410\u0434\u043c\u0438\u0440\u0430\u043b\u0442\u0435\u0439\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d",
"suburb": "Kolomna"
},
"display_name": "126, Fontanka River Embankment, Kolomna, Saint Petersburg, \u0410\u0434\u043c\u0438\u0440\u0430\u043b\u0442\u0435\u0439\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Saint Petersburg, Northwestern Federal District, 190000, Russian Federation",
"lat": "59.9180615",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
"lon": "30.3059528150966",
"osm_id": "1122295",
"osm_type": "relation",
"place_id": "158850652"
};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=55.7780&lon=49.1303&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_tatarstan = {"place_id":"33377476","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"2783648099","lat":"55.7779748","lon":"49.1296892","display_name":"Cinema Cafe, 6, Spartakovskaya Street, \u041a\u0430\u043b\u0443\u0433\u0430, \u0412\u0430\u0445\u0438\u0442\u043e\u0432\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, \u041a\u0430\u0437\u0430\u043d\u044c, \u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u041a\u0430\u0437\u0430\u043d\u044c, Tatarstan, Volga Federal District, 420106, Russian Federation","address":{"cafe":"Cinema Cafe","house_number":"6","road":"Spartakovskaya Street","suburb":"\u041a\u0430\u043b\u0443\u0433\u0430","city_district":"\u0412\u0430\u0445\u0438\u0442\u043e\u0432\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","city":"\u041a\u0430\u0437\u0430\u043d\u044c","county":"\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u041a\u0430\u0437\u0430\u043d\u044c","state":"Tatarstan","postcode":"420106","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=54.1264&lon=56.5797&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_bashkortostan = {"place_id":"4367634","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"489344251","lat":"54.190107","lon":"56.5377028","display_name":"\u041d\u043e\u0432\u043e\u0437\u0438\u0440\u0438\u043a\u043e\u0432\u043e, \u0413\u0430\u0444\u0443\u0440\u0438\u0439\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Bashkortostan, Volga Federal District, Russian Federation","address":{"hamlet":"\u041d\u043e\u0432\u043e\u0437\u0438\u0440\u0438\u043a\u043e\u0432\u043e","county":"\u0413\u0430\u0444\u0443\u0440\u0438\u0439\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Bashkortostan","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=55.4871&lon=47.1659&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_chuvash = {"place_id":"92041184","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"115006808","lat":"55.5013946","lon":"47.165831","display_name":"97\u041a-021, \u0410\u0447\u0430\u043a\u0430\u0441\u044b, \u041a\u0430\u043d\u0430\u0448\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Chuvashia, Volga Federal District, Russian Federation","address":{"road":"97\u041a-021","village":"\u0410\u0447\u0430\u043a\u0430\u0441\u044b","county":"\u041a\u0430\u043d\u0430\u0448\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Chuvashia","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=62.1010&lon=129.7176&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_sakha = {"place_id":"157409650","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"297831427","lat":"62.10115345","lon":"129.71764735","display_name":"17, \u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0443\u043b\u043e\u043a, \u0440\u0430\u0439\u043e\u043d \u041f\u043b\u0435\u043c\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, Yakutsk, \u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u042f\u043a\u0443\u0442\u0441\u043a, Sakha Republic, Far Eastern Federal District, 677901, Russian Federation","address":{"house_number":"17","road":"\u0426\u0435\u043d\u0442\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0443\u043b\u043e\u043a","suburb":"\u0440\u0430\u0439\u043e\u043d \u041f\u043b\u0435\u043c\u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435","city":"Yakutsk","county":"\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u042f\u043a\u0443\u0442\u0441\u043a","state":"Sakha Republic","postcode":"677901","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=46.524&lon=44.731&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_kalmykia = {"place_id":"155691118","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"292575902","lat":"46.58413215","lon":"44.778536225","display_name":"\u041c\u0430\u0439\u0441\u043a\u0438\u0439, \u0426\u0435\u043b\u0438\u043d\u043d\u044b\u0439 \u0440\u0430\u0439\u043e\u043d, Republic of Kalmykia, South federal district, Russian Federation","address":{"hamlet":"\u041c\u0430\u0439\u0441\u043a\u0438\u0439","county":"\u0426\u0435\u043b\u0438\u043d\u043d\u044b\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Republic of Kalmykia","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=52.014&lon=109.366&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_buryatia = {"place_id":"158771291","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"195223","lat":"52.4290635","lon":"109.517969733203","display_name":"Khorinsky Rayon, Buryatia, Siberian Federal District, Russian Federation","address":{"county":"Khorinsky Rayon","state":"Buryatia","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=63.832&lon=33.626&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_karelia = {"place_id":"158846852","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"1020571","lat":"63.94629385","lon":"33.5193580207717","display_name":"\u0427\u0435\u0440\u043d\u043e\u043f\u043e\u0440\u043e\u0436\u0441\u043a\u043e\u0435 \u0441\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u043e\u0441\u0435\u043b\u0435\u043d\u0438\u0435, \u0421\u0435\u0433\u0435\u0436\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Republic of Karelia, Northwestern Federal District, Russian Federation","address":{"city":"\u0427\u0435\u0440\u043d\u043e\u043f\u043e\u0440\u043e\u0436\u0441\u043a\u043e\u0435 \u0441\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u043e\u0441\u0435\u043b\u0435\u043d\u0438\u0435","county":"\u0421\u0435\u0433\u0435\u0436\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Republic of Karelia","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=56.8642&lon=53.2054&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_udmurtia = {"place_id":"74363539","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"59171598","lat":"56.86426315","lon":"53.2058149501383","display_name":"390, \u0443\u043b\u0438\u0446\u0430 \u041a\u0430\u0440\u043b\u0430 \u041c\u0430\u0440\u043a\u0441\u0430, \u041e\u043a\u0442\u044f\u0431\u0440\u044c\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Izhevsk, \u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u0418\u0436\u0435\u0432\u0441\u043a, \u0423\u0434\u043c\u0443\u0440\u0442\u0441\u043a\u0430\u044f \u0440\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430, Volga Federal District, 426008, Russian Federation","address":{"house_number":"390","road":"\u0443\u043b\u0438\u0446\u0430 \u041a\u0430\u0440\u043b\u0430 \u041c\u0430\u0440\u043a\u0441\u0430","city_district":"\u041e\u043a\u0442\u044f\u0431\u0440\u044c\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","city":"Izhevsk","county":"\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u0418\u0436\u0435\u0432\u0441\u043a","state":"\u0423\u0434\u043c\u0443\u0440\u0442\u0441\u043a\u0430\u044f \u0440\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430","postcode":"426008","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=44.60627&lon=40.10432&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_adygea = {"place_id":"117083297","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"178119466","lat":"44.60635535","lon":"40.103552511385","display_name":"\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0433.\u041c\u0430\u0439\u043a\u043e\u043f\u0430, 21, \u041a\u0440\u0430\u0441\u043d\u043e\u043e\u043a\u0442\u044f\u0431\u0440\u044c\u0441\u043a\u0430\u044f \u0443\u043b\u0438\u0446\u0430, Maykop, \u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u041c\u0430\u0439\u043a\u043e\u043f, Adygea, South federal district, 385006, Russian Federation","address":{"townhall":"\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0433.\u041c\u0430\u0439\u043a\u043e\u043f\u0430","house_number":"21","road":"\u041a\u0440\u0430\u0441\u043d\u043e\u043e\u043a\u0442\u044f\u0431\u0440\u044c\u0441\u043a\u0430\u044f \u0443\u043b\u0438\u0446\u0430","city":"Maykop","county":"\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u041c\u0430\u0439\u043a\u043e\u043f","state":"Adygea","postcode":"385006","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.118&lon=46.959&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_dagestan = {"place_id":"8585510","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"915341178","lat":"43.1134014","lon":"47.0808948","display_name":"\u0423\u0447\u043a\u0435\u043d\u0442, \u041a\u0443\u043c\u0442\u043e\u0440\u043a\u0430\u043b\u0438\u043d\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Republic of Dagestan, North Caucasus federal district, Russian Federation","address":{"village":"\u0423\u0447\u043a\u0435\u043d\u0442","county":"\u041a\u0443\u043c\u0442\u043e\u0440\u043a\u0430\u043b\u0438\u043d\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Republic of Dagestan","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.1171&lon=44.8626&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_ingushetia = {"place_id":"156030007","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"293569945","lat":"43.1456795","lon":"44.8365875","display_name":"P 721, \u0441\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u043e\u0441\u0435\u043b\u0435\u043d\u0438\u0435 \u0410\u043b\u0438-\u042e\u0440\u0442, \u041d\u0430\u0437\u0440\u0430\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Ingushetia, North Caucasus federal district, 386125, Russian Federation","address":{"road":"P 721","city":"\u0441\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u043e\u0441\u0435\u043b\u0435\u043d\u0438\u0435 \u0410\u043b\u0438-\u042e\u0440\u0442","county":"\u041d\u0430\u0437\u0440\u0430\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Ingushetia","postcode":"386125","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.7916&lon=41.7268&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_karachayCherkess = {"place_id":"82077979","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"85989954","lat":"43.8052673","lon":"41.7291051","display_name":"\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u041e\u043a\u0442\u044f\u0431\u0440\u044c-\u0425\u0430\u0441\u0430\u0443\u0442 \u0413\u0440\u0435\u0447\u0435\u0441\u043a\u043e\u0435, \u0417\u0435\u043b\u0435\u043d\u0447\u0443\u043a\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, \u041a\u0430\u0440\u0430\u0447\u0430\u0435\u0432\u043e-\u0427\u0435\u0440\u043a\u0435\u0441\u0441\u043a\u0430\u044f \u0440\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430, North Caucasus federal district, Russian Federation","address":{"road":"\u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u041e\u043a\u0442\u044f\u0431\u0440\u044c-\u0425\u0430\u0441\u0430\u0443\u0442 \u0413\u0440\u0435\u0447\u0435\u0441\u043a\u043e\u0435","county":"\u0417\u0435\u043b\u0435\u043d\u0447\u0443\u043a\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"\u041a\u0430\u0440\u0430\u0447\u0430\u0435\u0432\u043e-\u0427\u0435\u0440\u043a\u0435\u0441\u0441\u043a\u0430\u044f \u0440\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.451&lon=45.700&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_chechnya = {"place_id":"159190811","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"3888369","lat":"43.35498065","lon":"45.7216713693354","display_name":"\u041b\u0435\u043d\u0438\u043d\u0441\u043a\u0438\u0439, Grozny, \u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u0413\u0440\u043e\u0437\u043d\u044b\u0439, Chechen Republic, North Caucasus federal district, Russian Federation","address":{"city_district":"\u041b\u0435\u043d\u0438\u043d\u0441\u043a\u0438\u0439","city":"Grozny","county":"\u0433\u043e\u0440\u043e\u0434\u0441\u043a\u043e\u0439 \u043e\u043a\u0440\u0443\u0433 \u0413\u0440\u043e\u0437\u043d\u044b\u0439","state":"Chechen Republic","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.497&lon=43.423&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_kabardinoBalkaria = {"place_id":"12000590","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"1176698285","lat":"43.5613295","lon":"43.4302516","display_name":"\u041b\u0435\u0447\u0438\u043d\u043a\u0430\u0439, \u0427\u0435\u0433\u0435\u043c\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, \u041a\u0430\u0431\u0430\u0440\u0434\u0438\u043d\u043e-\u0411\u0430\u043b\u043a\u0430\u0440\u0441\u043a\u0430\u044f \u0440\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430, North Caucasus federal district, Russian Federation","address":{"village":"\u041b\u0435\u0447\u0438\u043d\u043a\u0430\u0439","county":"\u0427\u0435\u0433\u0435\u043c\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"\u041a\u0430\u0431\u0430\u0440\u0434\u0438\u043d\u043e-\u0411\u0430\u043b\u043a\u0430\u0440\u0441\u043a\u0430\u044f \u0440\u0435\u0441\u043f\u0443\u0431\u043b\u0438\u043a\u0430","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=50.900&lon=86.899&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_altai = {"place_id":"158766852","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"192546","lat":"50.74112365","lon":"86.3687137822935","display_name":"Ongudaysky Rayon, Altai Republic, Siberian Federal District, Russian Federation","address":{"county":"Ongudaysky Rayon","state":"Altai Republic","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=51.781&lon=94.033&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_tyva = {"place_id":"158765550","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"190766","lat":"52.31183635","lon":"94.1400217560473","display_name":"Piy-Khemsky Kozhuun, Tuva, Siberian Federal District, Russian Federation","address":{"county":"Piy-Khemsky Kozhuun","state":"Tuva","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=51.335&lon=46.668&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_saratov = {"place_id":"63722839","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"31715230","lat":"51.2934885","lon":"46.6636942","display_name":"E 38, \u0421\u043e\u0432\u0435\u0442\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Saratov Oblast, Volga Federal District, Russian Federation","address":{"road":"E 38","county":"\u0421\u043e\u0432\u0435\u0442\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Saratov Oblast","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=52.952&lon=33.283&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_bryansk = {"place_id":"121844937","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"190394567","lat":"52.9876239","lon":"33.2285656","display_name":"\u00ab\u0411\u0440\u044f\u043d\u0441\u043a \u2014 \u041d\u043e\u0432\u043e\u0437\u044b\u0431\u043a\u043e\u0432\u00bb \u2014 \u041c\u0433\u043b\u0438\u043d, \u0411\u0435\u0440\u0451\u0437\u043e\u0432\u043a\u0430, \u041f\u043e\u0447\u0435\u043f\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d, Bryansk Oblast, Central Federal District, Russian Federation","address":{"road":"\u00ab\u0411\u0440\u044f\u043d\u0441\u043a \u2014 \u041d\u043e\u0432\u043e\u0437\u044b\u0431\u043a\u043e\u0432\u00bb \u2014 \u041c\u0433\u043b\u0438\u043d","hamlet":"\u0411\u0435\u0440\u0451\u0437\u043e\u0432\u043a\u0430","county":"\u041f\u043e\u0447\u0435\u043f\u0441\u043a\u0438\u0439 \u0440\u0430\u0439\u043e\u043d","state":"Bryansk Oblast","country":"Russian Federation","country_code":"ru"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=64.191&lon=55.826&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_russia_komi = {"place_id":"158847082","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"1082933","lat":"65.0204625","lon":"57.3740830196108","display_name":"\u0440\u0430\u0439\u043e\u043d \u041f\u0435\u0447\u043e\u0440\u0430, Komi Republic, Northwestern Federal District, Russian Federation","address":{"county":"\u0440\u0430\u0439\u043e\u043d \u041f\u0435\u0447\u043e\u0440\u0430","state":"Komi Republic","country":"Russian Federation","country_code":"ru"}};
/* }}} */
/* USA {{{ */
var nominatimTestJSON_usa_state_unknown = {
"address": {
"country": "United States of America",
"country_code": "us",
// "city": "Washington",
// "county": "District of Columbia",
// "information": "White House Visitor Center",
// "neighbourhood": "Franklin McPherson Square",
"postcode": "20500",
// "road": "Ellipse Road Northwest",
// "suburb": "Southwest Waterfront"
},
// "display_name": "White House Visitor Center, Ellipse Road Northwest, Franklin McPherson Square, Southwest Waterfront, Washington, District of Columbia, 20500, United States of America",
"lat": "38.895048",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
"lon": "-77.035046",
"osm_id": "2525694724",
"osm_type": "node",
"place_id": "25998054"
};
/* Washington DC {{{ */
// https://nominatim.openstreetmap.org/reverse?format=json&lat=38.8953&lon=-77.0356&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_washingtondc = {
"address": {
// "city": "Washington",
"country": "United States of America",
"country_code": "us",
"county": "District of Columbia",
"information": "White House Visitor Center",
"neighbourhood": "Franklin McPherson Square",
"postcode": "20500",
"road": "Ellipse Road Northwest",
"suburb": "Southwest Waterfront"
},
"display_name": "White House Visitor Center, Ellipse Road Northwest, Franklin McPherson Square, Southwest Waterfront, Washington, District of Columbia, 20500, United States of America",
"lat": "38.895048",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
"lon": "-77.035046",
"osm_id": "2525694724",
"osm_type": "node",
"place_id": "25998054"
};
/* }}} */
/* Alabama {{{ */
// https://nominatim.openstreetmap.org/reverse?format=json&lat=32.3673&lon=-86.2983&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_alabama = {
"address": {
"city": "Montgomery",
"country": "United States of America",
"country_code": "us",
"county": "Montgomery County",
"postcode": "36104",
"road": "Genetta Court",
"state": "Alabama"
},
"display_name": "Genetta Court, Montgomery, Montgomery County, Alabama, 36104, United States of America",
"lat": "32.366649",
"licence": "Data \u00a9 OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
"lon": "-86.2990459",
"osm_id": "7928836",
"osm_type": "way",
"place_id": "49048248"
};
/* }}} */
// https://nominatim.openstreetmap.org/reverse?format=json&lat=64.5082&lon=-165.4066&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_alaska={"place_id":"49689315","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"8984498","lat":"64.5093904","lon":"-165.4064219","display_name":"North Star Assoc Access Road, Nome, Alaska, 99762, United States of America","address":{"road":"North Star Assoc Access Road","city":"Nome","county":"Nome","state":"Alaska","postcode":"99762","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=34.9378&lon=-109.7565&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_arizona={"place_id":"119968886","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"284558228","lat":"34.9381065","lon":"-109.7597016","display_name":"Blue Mesa Trail, Apache County, Arizona, United States of America","address":{"footway":"Blue Mesa Trail","county":"Apache County","state":"Arizona","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=34.74610&lon=-92.29054&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_arkansas={"place_id":"52473261","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"12933666","lat":"34.746454","lon":"-92.2903549","display_name":"Capitol Mall, Little Rock, Pulaski County, Arkansas, 72201, United States of America","address":{"road":"Capitol Mall","city":"Little Rock","county":"Pulaski County","state":"Arkansas","postcode":"72201","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=40.8001&lon=-124.1698&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_california={"place_id":"15825908","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"1491131029","lat":"40.7997997","lon":"-124.1704456","display_name":"Sole Savers Used Cars, 7th Street, Eureka, Humboldt County, California, 95501, United States of America","address":{"car":"Sole Savers Used Cars","road":"7th Street","city":"Eureka","county":"Humboldt County","state":"California","postcode":"95501","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=39.1804&lon=-106.8218&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_colorado={"place_id":"121524489","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"292950875","lat":"39.179721","lon":"-106.8236546","display_name":"West Side, Aspen, Pitkin County, Colorado, 81611, United States of America","address":{"path":"West Side","city":"Aspen","county":"Pitkin County","state":"Colorado","postcode":"81611","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=41.9111&lon=-72.16014&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_connecticut={"place_id":"21360915","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"2164630561","lat":"41.9112481","lon":"-72.1601503","display_name":"Pixi Falls, Nipmuck Trail, Westford, Windham County, Connecticut, 06278, United States of America","address":{"viewpoint":"Pixi Falls","footway":"Nipmuck Trail","hamlet":"Westford","county":"Windham County","state":"Connecticut","postcode":"06278","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=38.7113&lon=-75.0978&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_delaware={"place_id":"66739225","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"47999971","lat":"38.710581","lon":"-75.0967069","display_name":"Road 273C, Phil Mar Estates, Sussex County, Delaware, 19971, United States of America","address":{"road":"Road 273C","hamlet":"Phil Mar Estates","county":"Sussex County","state":"Delaware","postcode":"19971","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=25.7720&lon=-80.1324&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_florida={"place_id":"116692522","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"266382359","lat":"25.7718665","lon":"-80.1312973","display_name":"South of Fifth Sandwalk, Miami Beach, Miami-Dade County, Florida, 33109, United States of America","address":{"path":"South of Fifth Sandwalk","city":"Miami Beach","county":"Miami-Dade County","state":"Florida","postcode":"33109","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=31.0823&lon=-81.4192&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_georgia={"place_id":"49510144","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"9260878","lat":"31.083523","lon":"-81.4209829","display_name":"Jennings Road, Glynn County, Georgia, 31527, United States of America","address":{"road":"Jennings Road","county":"Glynn County","state":"Georgia","postcode":"31527","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=13.4311&lon=144.6549&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_guam={"place_id":"64236526","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"36979005","lat":"13.4188011","lon":"144.6577079","display_name":"Marine Corps Drive, Apra Harbor, Guam County, Guam, United States of America","address":{"road":"Marine Corps Drive","locality":"Apra Harbor","county":"Guam County","state":"Guam","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=19.6423&lon=-155.4837&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_hawaii={"place_id":"66164927","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"45698610","lat":"19.62918","lon":"-155.5398599","display_name":"Hilo Kona Road, Kailua-Kona, Hawai\u02bbi County, Hawaii, United States of America","address":{"road":"Hilo Kona Road","city":"Kailua-Kona","county":"Hawai\u02bbi County","state":"Hawaii","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=47.6710&lon=-116.7671&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_idaho={"place_id":"53105523","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"13846067","lat":"47.670042","lon":"-116.7670899","display_name":"South Dollar Street, Coeur d'Alene, Kootenai County, Idaho, 83814, United States of America","address":{"road":"South Dollar Street","city":"Coeur d'Alene","county":"Kootenai County","state":"Idaho","postcode":"83814","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=42.05202&lon=-87.67594&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_illinois={"place_id":"63158773","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"33908928","lat":"42.05189995","lon":"-87.6759578506092","display_name":"University Hall, 1897, Sheridan Road, Downtown, Evanston, Cook County, Illinois, 60208, United States of America","address":{"building":"University Hall","house_number":"1897","road":"Sheridan Road","neighbourhood":"Downtown","city":"Evanston","county":"Cook County","state":"Illinois","postcode":"60208","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=40.4179&lon=-86.8969&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_indiana={"place_id":"71946986","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"74495138","lat":"40.4182607","lon":"-86.8976521","display_name":"Columbia Street, Happy Hollow Heights, Tippecanoe County, Indiana, 47901, United States of America","address":{"road":"Columbia Street","hamlet":"Happy Hollow Heights","county":"Tippecanoe County","state":"Indiana","postcode":"47901","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=41.9747&lon=-91.6760&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_iowa={"place_id":"98812115","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"185310640","lat":"41.9750617","lon":"-91.6757381247816","display_name":"Linn County Sheriffs Department, I 380;IA 27, Cedar Rapids, Linn County, Iowa, 52401, United States of America","address":{"police":"Linn County Sheriffs Department","road":"I 380;IA 27","city":"Cedar Rapids","county":"Linn County","state":"Iowa","postcode":"52401","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=37.6888&lon=-97.3271&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_kansas={"place_id":"92181389","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"161510053","lat":"37.6887661","lon":"-97.3278952567447","display_name":"Old Town Parking Garage, North Rock Island, Wichita, Sedgwick County, Kansas, 67202, United States of America","address":{"parking":"Old Town Parking Garage","road":"North Rock Island","city":"Wichita","county":"Sedgwick County","state":"Kansas","postcode":"67202","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=36.8446&lon=-83.3196&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_kentucky={"place_id":"54458735","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"16198892","lat":"36.844965","lon":"-83.3193679","display_name":"KY 38, Harlan, Harlan County, Kentucky, 40831, United States of America","address":{"road":"KY 38","city":"Harlan","county":"Harlan County","state":"Kentucky","postcode":"40831","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=30.1800&lon=-90.1787&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_louisiana={"place_id":"127893731","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"relation","osm_id":"1836431","lat":"30.421468","lon":"-89.9617631947467","display_name":"St. Tammany Parish, Louisiana, United States of America","address":{"county":"St. Tammany Parish","state":"Louisiana","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=44.7903&lon=-68.7829&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_maine={"place_id":"66188993","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"43376862","lat":"44.7904848","lon":"-68.7829047111113","display_name":"Bangor Raceway\/OTB, Bangor, Penobscot County, Maine, 04412, United States of America","address":{"raceway":"Bangor Raceway\/OTB","city":"Bangor","county":"Penobscot County","state":"Maine","postcode":"04412","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=38.3206&lon=-75.6213&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_maryland={"place_id":"66529051","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"47701025","lat":"38.3152772","lon":"-75.6248896","display_name":"South Fruitland Boulevard, Fruitland, Wicomico County, Maryland, 21826, United States of America","address":{"road":"South Fruitland Boulevard","city":"Fruitland","county":"Wicomico County","state":"Maryland","postcode":"21826","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=42.3550&lon=-71.0645&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_massachusetts={"place_id":"59715429","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"24677646","lat":"42.35546545","lon":"-71.0638843757496","display_name":"Visitor Information Center at Boston Common, 148, Tremont Street, Chinatown, Beacon Hill, Boston, Suffolk County, Massachusetts, 02111, United States of America","address":{"information":"Visitor Information Center at Boston Common","house_number":"148","road":"Tremont Street","neighbourhood":"Chinatown","suburb":"Beacon Hill","city":"Boston","county":"Suffolk County","state":"Massachusetts","postcode":"02111","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=42.7153&lon=-84.4995&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_michigan={"place_id":"117203493","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"264540336","lat":"42.71532985","lon":"-84.4995249806439","display_name":"Building 1572, 30, Middlevale Road, Spartan Village, East Lansing, Ingham County, Michigan, 48823, United States of America","address":{"building":"Building 1572","house_number":"30","road":"Middlevale Road","residential":"Spartan Village","city":"East Lansing","county":"Ingham County","state":"Michigan","postcode":"48823","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=47.8278&lon=-90.0484&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_minnesota={"place_id":"69420336","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"56684658","lat":"47.8397542","lon":"-90.0551622","display_name":"Superior Hiking Trail, Cook County, Minnesota, United States of America","address":{"footway":"Superior Hiking Trail","county":"Cook County","state":"Minnesota","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=30.3986&lon=-88.8820&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_mississippi={"place_id":"93852729","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"165919984","lat":"30.3984797","lon":"-88.8818930732571","display_name":"189, Bellman Street, Biloxi, Harrison County, Mississippi, 39501, United States of America","address":{"house_number":"189","road":"Bellman Street","city":"Biloxi","county":"Harrison County","state":"Mississippi","postcode":"39501","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=37.0799&lon=-94.5060&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_missouri={"place_id":"56101640","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"18514619","lat":"37.08136","lon":"-94.5070289","display_name":"Iowa Avenue, Joplin, Jasper County, Missouri, 64801, United States of America","address":{"road":"Iowa Avenue","city":"Joplin","county":"Jasper County","state":"Missouri","postcode":"64801","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=48.3866&lon=-115.5498&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_montana={"place_id":"68329859","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"51770096","lat":"48.386884","lon":"-115.5513568","display_name":"East 9th Street, Libby, Lincoln County, Montana, 59923, United States of America","address":{"road":"East 9th Street","city":"Libby","county":"Lincoln County","state":"Montana","postcode":"59923","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=41.2587&lon=-95.9374&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_nebraska={"place_id":"114746992","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"256624885","lat":"41.25918915","lon":"-95.9378725469971","display_name":"First National Bank Tower, 1601, Dodge Street, Omaha, Douglas County, Nebraska, 68102, United States of America","address":{"building":"First National Bank Tower","house_number":"1601","road":"Dodge Street","city":"Omaha","county":"Douglas County","state":"Nebraska","postcode":"68102","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=36.1215&lon=-115.1704&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_nevada={"place_id":"63631543","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"33996606","lat":"36.1217339","lon":"-115.1705755","display_name":"Rialto bridge, Hughes Center, Paradise, Clark County, Nevada, 89109, United States of America","address":{"footway":"Rialto bridge","suburb":"Hughes Center","town":"Paradise","county":"Clark County","state":"Nevada","postcode":"89109","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.5628&lon=-71.9447&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_newhampshire={"place_id":"56068503","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"18851394","lat":"43.560882","lon":"-71.9468629","display_name":"Library Road, Grafton, Grafton County, New Hampshire, 03240, United States of America","address":{"road":"Library Road","town":"Grafton","county":"Grafton County","state":"New Hampshire","postcode":"03240","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=39.9475&lon=-75.1066&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_newjersey={"place_id":"51221798","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"11599189","lat":"39.949244","lon":"-75.1070549","display_name":"Centennial Drive, Camden, Camden County, New Jersey, 08105, United States of America","address":{"road":"Centennial Drive","city":"Camden","county":"Camden County","state":"New Jersey","postcode":"08105","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=34.0790&lon=-107.6179&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_newmexico={"place_id":"77778505","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"104970602","lat":"34.0684393","lon":"-107.6114804","display_name":"Old Highway 60, Socorro County, New Mexico, United States of America","address":{"road":"Old Highway 60","county":"Socorro County","state":"New Mexico","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=42.8126&lon=-73.9379&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_newyork={"place_id":"84525817","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"126855890","lat":"42.81240725","lon":"-73.9381957169258","display_name":"Franklin Plaza, Lafayette Street, City of Schenectady, Schenectady County, New York, 12305, United States of America","address":{"building":"Franklin Plaza","road":"Lafayette Street","city":"City of Schenectady","county":"Schenectady County","state":"New York","postcode":"12305","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=35.7802&lon=-78.6394&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_northcarolina={"place_id":"99468133","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"189846068","lat":"35.7804055","lon":"-78.639099844006","display_name":"Union Square, East Edenton Street, Warehouse District, Raleigh, Wake County, North Carolina, 27601, United States of America","address":{"park":"Union Square","road":"East Edenton Street","suburb":"Warehouse District","city":"Raleigh","county":"Wake County","state":"North Carolina","postcode":"27601","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=48.1459&lon=-103.6232&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_northdakota={"place_id":"49344497","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"9835550","lat":"48.148945","lon":"-103.6237439","display_name":"1st Avenue West, Williston, Williams County, North Dakota, 58801, United States of America","address":{"road":"1st Avenue West","city":"Williston","county":"Williams County","state":"North Dakota","postcode":"58801","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=41.4846&lon=-82.6852&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_ohio={"place_id":"56170259","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"19039813","lat":"41.4843124","lon":"-82.6844091","display_name":"Perimeter Road, Sandusky, Erie County, Ohio, United States of America","address":{"road":"Perimeter Road","city":"Sandusky","county":"Erie County","state":"Ohio","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=36.0514&lon=-95.7892&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_oklahoma={"place_id":"53556138","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"15043426","lat":"36.051459","lon":"-95.7877959","display_name":"East Commercial Street, Broken Arrow, Tulsa County, Oklahoma, 74012, United States of America","address":{"road":"East Commercial Street","city":"Broken Arrow","county":"Tulsa County","state":"Oklahoma","postcode":"74012","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=45.3732&lon=-121.6959&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_oregon={"place_id":"88189444","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"146985872","lat":"45.3834699","lon":"-121.6675317","display_name":"Cooper Spur #600B, Hood River County, Oregon, United States of America","address":{"footway":"Cooper Spur #600B","county":"Hood River County","state":"Oregon","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=40.3340&lon=-75.9300&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_pennsylvania={"place_id":"116304319","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"260794611","lat":"40.3340718","lon":"-75.9294293956808","display_name":"Parking Garage, Cherry Street, Reading, Berks County, Pennsylvania, 19602, United States of America","address":{"parking":"Parking Garage","road":"Cherry Street","city":"Reading","county":"Berks County","state":"Pennsylvania","postcode":"19602","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=18.4364&lon=-66.1188&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_puertorico={"place_id":"57584232","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"22162032","lat":"18.435917","lon":"-66.1189319","display_name":"Calle Antonio R Barcel\u00f3, Pueblo Viejo, Guaynabo, Puerto Rico, 00965, United States of America","address":{"road":"Calle Antonio R Barcel\u00f3","city":"Pueblo Viejo","county":"Guaynabo","state":"Puerto Rico","postcode":"00965","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=41.8251&lon=-71.4194&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_rhodeisland={"place_id":"83352312","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"123069111","lat":"41.82518","lon":"-71.4193269","display_name":"I 95, Providence, Providence County, Rhode Island, 02903, United States of America","address":{"road":"I 95","city":"Providence","county":"Providence County","state":"Rhode Island","postcode":"02903","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=32.7878&lon=-79.9392&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_southcarolina={"place_id":"111459509","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"241968972","lat":"32.7876248","lon":"-79.9386555934906","display_name":"Dream Factory, Warren Street, Charleston, Charleston County, South Carolina, 29424, United States of America","address":{"building":"Dream Factory","road":"Warren Street","city":"Charleston","county":"Charleston County","state":"South Carolina","postcode":"29424","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=43.7148&lon=-98.0249&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_southdakota={"place_id":"71642010","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"73851137","lat":"43.71474935","lon":"-98.0248767861259","display_name":"Mitchell Corn Palace, East 6th Avenue, Mitchell, Davison County, South Dakota, 57301, United States of America","address":{"attraction":"Mitchell Corn Palace","road":"East 6th Avenue","city":"Mitchell","county":"Davison County","state":"South Dakota","postcode":"57301","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=35.1438&lon=-90.0231&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_tennessee={"place_id":"83552895","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"124068656","lat":"35.1386836","lon":"-90.0240493","display_name":"I 240, Memphis, Shelby County, Tennessee, 38104, United States of America","address":{"road":"I 240","city":"Memphis","county":"Shelby County","state":"Tennessee","postcode":"38104","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=30.2655&lon=-97.7559&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_texas={"place_id":"111446948","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"238575801","lat":"30.2657266","lon":"-97.7556813","display_name":"Pfluger Pedestrian Bridge, Austin, Travis County, Texas, 78746, United States of America","address":{"footway":"Pfluger Pedestrian Bridge","city":"Austin","county":"Travis County","state":"Texas","postcode":"78746","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=18.3433&lon=-64.9347&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_virginislands={"place_id":"2526584","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"node","osm_id":"356559537","lat":"18.3430118","lon":"-64.9354233","display_name":"Christ Church Methodist Church, Rosen Gade, Charlotte Amalie, St. Thomas Island, United States Virgin Islands, 00803, United States of America","address":{"place_of_worship":"Christ Church Methodist Church","road":"Rosen Gade","town":"Charlotte Amalie","county":"St. Thomas Island","state":"United States Virgin Islands","postcode":"00803","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=40.5888&lon=-111.6378&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_utah={"place_id":"115632992","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"257809595","lat":"40.5886217","lon":"-111.6378685","display_name":"Alta Lodge Tow, East Perruvian Acre Road, Alta, Salt Lake County, Utah, United States of America","address":{"address29":"Alta Lodge Tow","road":"East Perruvian Acre Road","town":"Alta","county":"Salt Lake County","state":"Utah","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=44.2597&lon=-72.5800&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_vermont={"place_id":"112934331","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"244468089","lat":"44.25920675","lon":"-72.5796506738965","display_name":"53, Memorial Drive, Montpelier, Washington County, Vermont, 05602, United States of America","address":{"house_number":"53","road":"Memorial Drive","city":"Montpelier","county":"Washington County","state":"Vermont","postcode":"05602","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=36.9454&lon=-76.2888&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_virginia={"place_id":"67801749","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"48865930","lat":"36.944601","lon":"-76.2960629","display_name":"Bellinger Blvd, Glenwood Park, Norfolk, Virginia, 23511, United States of America","address":{"road":"Bellinger Blvd","hamlet":"Glenwood Park","city":"Norfolk","state":"Virginia","postcode":"23511","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=46.8598&lon=-121.7256&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_washington={"place_id":"110787862","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"235233247","lat":"46.8223122","lon":"-121.7272168","display_name":"Camp Muir Route, Paradise, Pierce County, Washington, United States of America","address":{"footway":"Camp Muir Route","hamlet":"Paradise","county":"Pierce County","state":"Washington","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=38.3686&lon=-81.6070&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_westvirginia={"place_id":"53946928","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"15572790","lat":"38.368065","lon":"-81.6063089","display_name":"Barlow Drive, Twomile, Kanawha County, West Virginia, 25311, United States of America","address":{"road":"Barlow Drive","hamlet":"Twomile","county":"Kanawha County","state":"West Virginia","postcode":"25311","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=45.8719&lon=-89.6930&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_wisconsin={"place_id":"58231065","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"21562994","lat":"45.8707426","lon":"-89.6984064","display_name":"Cedar Street, Minocqua, Oneida County, Wisconsin, United States of America","address":{"road":"Cedar Street","village":"Minocqua","county":"Oneida County","state":"Wisconsin","country":"United States of America","country_code":"us"}};
// https://nominatim.openstreetmap.org/reverse?format=json&lat=42.8590&lon=-106.3126&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_usa_wyoming={"place_id":"54223976","licence":"Data \u00a9 OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright","osm_type":"way","osm_id":"15763013","lat":"42.8591296","lon":"-106.317155","display_name":"East H Street, Casper, Natrona County, Wyoming, 82601, United States of America","address":{"road":"East H Street","city":"Casper","county":"Natrona County","state":"Wyoming","postcode":"82601","country":"United States of America","country_code":"us"}};
/* }}} */
/* Italy {{{ */
var nominatimTestJSON_italy = {
"place_id" : "127565598",
"licence" : "Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright",
"osm_type" : "relation",
"osm_id" : "40784",
"lat" : "41.9808038",
"lon" : "12.7662312",
"display_name" : "Lazio, Italy",
"address": {
"state" : "Lazio",
"country" : "Italy",
"country_code" : "it",
},
}
/* }}} */
/* Czech Republic {{{ */
// https://nominatim.openstreetmap.org/reverse?format=json&lat=50.0874401&lon=14.4212556&zoom=18&addressdetails=1&accept-language=en
var nominatimTestJSON_czechRepublic = {
"place_id":"2582799432",
"licence":"Data © OpenStreetMap contributors, ODbL 1.0. http:\/\/www.openstreetmap.org\/copyright",
"osm_type":"way",
"osm_id":"340086966",
"lat":"50.08748275",
"lon":"14.4213733265222",
//"display_name":"Pražský poledník, Staroměstské náměstí, Old Town, Prague, okres Hlavní město Praha, Hlavní město Praha, Praha, 11000, Czech Republic",
"address": {
//"memorial":"Pražský poledník",
//"pedestrian":"Staroměstské náměstí",
//"suburb":"Old Town",
//"city":"Prague",
//"county":"okres Hlavní město Praha",
//"state":"Praha",
"postcode":"11000",
"country":"Czech Republic",
"country_code":"cz"
}
}
/* }}} */
/* }}} */
/* }}} */
var sane_value_suffix = '; 00:23-00:42 closed "warning at correct position?"';
// Suffix to add to values to make the value more complex and to spot problems
// easier without changing there meaning (in most cases).
var value_suffix = '; 00:23-00:42 unknown "warning at correct position?"';
// This suffix value is there to test if the warning marks the correct position of the problem.
var value_suffix_to_disable_time_not_used = ' 12:00-15:00';
var value_perfectly_valid = [
'Mo-Fr 12:00-18:00; We off; Sa,PH 12:00-17:00; Th[3],Th[-1] off',
'open; Tu-Su 08:30-09:00 off; Tu-Su,PH 14:00-14:30 off; Mo 08:00-13:00 off',
/* Don‘t use 24/7 instead of "open". PH usage does not make much sense … */
];
/* Used in the README and other places.
* Those values must be perfectly valid and not return any warnings,
* regardless of the warnings_severity.
*/
/* Avoid the warning that no time selector was used in a rule. Use this if you
* are checking for values which should return another warning.
* warning.
*/
// time ranges {{{
test.addTest('Time intervals', [
'10:00-12:00',
'08:00-09:00; 10:00-12:00',
'10:00-12:00,',
'10:00-12:00;',
'10-12', // Do not use. Returns warning.
'10:00-11:00,11:00-12:00',
'10:00-12:00,10:30-11:30',
'10:00-14:00; 12:00-14:00 off',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 10:00', '2012.10.01 12:00' ],
[ '2012.10.02 10:00', '2012.10.02 12:00' ],
[ '2012.10.03 10:00', '2012.10.03 12:00' ],
[ '2012.10.04 10:00', '2012.10.04 12:00' ],
[ '2012.10.05 10:00', '2012.10.05 12:00' ],
[ '2012.10.06 10:00', '2012.10.06 12:00' ],
[ '2012.10.07 10:00', '2012.10.07 12:00' ],
], 1000 * 60 * 60 * 2 * 7, 0, true, {}, 'not last test');
test.addTest('Time intervals', [
'24/7; Mo 15:00-16:00 off', // throws a warning, use next value which is equal.
'open; Mo 15:00-16:00 off',
'00:00-24:00; Mo 15:00-16:00 off',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 00:00', '2012.10.01 15:00' ],
[ '2012.10.01 16:00', '2012.10.08 00:00' ],
], 1000 * 60 * 60 * (24 * 6 + 23), 0, true, {}, 'not last test');
test.addTest('Time zero intervals (always closed)', [
'off',
'closed',
ignored('always closed', 'prettifyValue'),
'off; closed',
'24/7 closed "always closed"', // Used on the demo page.
'24/7: closed "always closed"',
'24/7 closed: "always closed"',
'24/7: closed: "always closed"',
'closed "always closed"',
'off "always closed"',
'00:00-24:00 closed',
'24/7 closed',
], '2012.10.01 0:00', '2018.10.08 0:00', [
], 0, 0, true, {}, 'not last test');
test.addTest('Time zero intervals (always closed), prettifyValue is OK …', [
ignored('yes', 'prettifyValue'),
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 00:00', '2012.10.01 06:00', false, 'specified as yes: At night (unknown time schedule or daylight detection)' ], // 6
[ '2012.10.01 18:00', '2012.10.02 06:00', false, 'specified as yes: At night (unknown time schedule or daylight detection)' ], // 12
[ '2012.10.02 18:00', '2012.10.03 00:00', false, 'specified as yes: At night (unknown time schedule or daylight detection)' ], // 6
], 1000 * 60 * 60 * (6 + 12 + 6), 0, true, {}, 'not last test', { 'map_value': true, 'tag_key': 'lit' });
// error tolerance {{{
test.addTest('Error tolerance: dot as time separator', [
'10:00-12:00', // reference value for prettify
'10.00-12.00',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 10:00', '2012.10.01 12:00' ],
[ '2012.10.02 10:00', '2012.10.02 12:00' ],
[ '2012.10.03 10:00', '2012.10.03 12:00' ],
[ '2012.10.04 10:00', '2012.10.04 12:00' ],
[ '2012.10.05 10:00', '2012.10.05 12:00' ],
[ '2012.10.06 10:00', '2012.10.06 12:00' ],
[ '2012.10.07 10:00', '2012.10.07 12:00' ],
], 1000 * 60 * 60 * 2 * 7, 0, true, {}, 'not last test');
test.addTest('Error tolerance: dot as time separator', [
'10:00-14:00; 12:00-14:00 off', // reference value for prettify
'10-14; 12-14 off', // '22-2', // Do not use. Returns warning.
'10.00-14.00; 12.00-14.00 off',
// '10.00-12.00;10.30-11.30',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 10:00', '2012.10.01 12:00' ],
[ '2012.10.02 10:00', '2012.10.02 12:00' ],
[ '2012.10.03 10:00', '2012.10.03 12:00' ],
[ '2012.10.04 10:00', '2012.10.04 12:00' ],
[ '2012.10.05 10:00', '2012.10.05 12:00' ],
[ '2012.10.06 10:00', '2012.10.06 12:00' ],
[ '2012.10.07 10:00', '2012.10.07 12:00' ],
], 1000 * 60 * 60 * 2 * 7, 0, true, {}, 'not last test');
test.addTest('Error tolerance: Correctly handle pm time.', [
'10:00-12:00,13:00-20:00', // reference value for prettify
'10-12,13-20',
'10am-12am,1pm-8pm',
'10:00am-12:00am,1:00pm-8:00pm',
'10:00am-12:00am,1.00pm-8.00pm',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 10:00', '2012.10.01 12:00' ],
[ '2012.10.01 13:00', '2012.10.01 20:00' ],
[ '2012.10.02 10:00', '2012.10.02 12:00' ],
[ '2012.10.02 13:00', '2012.10.02 20:00' ],
], 1000 * 60 * 60 * (2 + 7) * 2, 0, true, {}, 'not last test');
test.addTest('Error tolerance: Correctly handle pm time.', [
'13:00-20:00,10:00-12:00', // reference value for prettify
'1pm-8pm,10am-12am',
// '1pm-8pm/10am-12am', // Can not be corrected as / is a valid token
'1:00pm-8:00pm,10:00am-12:00am',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 10:00', '2012.10.01 12:00' ],
[ '2012.10.01 13:00', '2012.10.01 20:00' ],
[ '2012.10.02 10:00', '2012.10.02 12:00' ],
[ '2012.10.02 13:00', '2012.10.02 20:00' ],
], 1000 * 60 * 60 * (2 + 7) * 2, 0, true, {}, 'not last test');
test.addTest('Error tolerance: Time intervals, short time', [
'Mo 07:00-18:00', //reference value for prettify
'Montags 07:00-18:00', //reference value for prettify
'Mo 7-18', // throws a warning, use previous value which is equal.
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 07:00', '2012.10.01 18:00' ],
], 1000 * 60 * 60 * 11, 0, true, {}, 'not last test');
test.addTest('Error tolerance: Time range', [
'Mo 12:00-14:00', // reference value for prettify
'Mo12:00-14:00',
'Mo 12:00→14:00',
'Mo 12:00–14:00',
'Mo 12:00−14:00',
'Mo 12:00—14:00',
'Mo 12:00ー14:00',
'Mo 12:00=14:00',
'Mo 12:00 to 14:00',
'Mo 12:00 до 14:00',
'Mo 12:00 a 14:00',
'Mo 12:00 as 14:00',
'Mo 12:00 á 14:00',
'Mo 12:00 ás 14:00',
'Mo 12:00 à 14:00',
'Mo 12:00 às 14:00',
'Mo 12:00 ate 14:00',
'Mo 12:00 till 14:00',
'Mo 12:00 til 14:00',
'Mo 12:00 until 14:00',
'Mo 12:00 through 14:00',
'Mo 12:00~14:00',
'Mo 12:00~14:00',
'Mo 12:00-14:00',
'Mo 12°°-14:00',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 12:00', '2012.10.01 14:00' ],
], 1000 * 60 * 60 * 2, 0, true, {}, 'not only test');
// }}}
// time range spanning midnight {{{
test.addTest('Time ranges spanning midnight', [
'22:00-02:00',
'22:00-26:00',
'22-2', // Do not use. Returns warning.
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 00:00', '2012.10.01 02:00' ],
[ '2012.10.01 22:00', '2012.10.02 02:00' ],
[ '2012.10.02 22:00', '2012.10.03 02:00' ],
[ '2012.10.03 22:00', '2012.10.04 02:00' ],
[ '2012.10.04 22:00', '2012.10.05 02:00' ],
[ '2012.10.05 22:00', '2012.10.06 02:00' ],
[ '2012.10.06 22:00', '2012.10.07 02:00' ],
[ '2012.10.07 22:00', '2012.10.08 00:00' ],
], 1000 * 60 * 60 * 4 * 7, 0, true, nominatimTestJSON);
test.addTest('Time ranges spanning midnight', [
'22:00-26:00', // reference value for prettify
'22-26', // Do not use. Returns warning.
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 00:00', '2012.10.01 02:00' ],
[ '2012.10.01 22:00', '2012.10.02 02:00' ],
[ '2012.10.02 22:00', '2012.10.03 02:00' ],
[ '2012.10.03 22:00', '2012.10.04 02:00' ],
[ '2012.10.04 22:00', '2012.10.05 02:00' ],
[ '2012.10.05 22:00', '2012.10.06 02:00' ],
[ '2012.10.06 22:00', '2012.10.07 02:00' ],
[ '2012.10.07 22:00', '2012.10.08 00:00' ],
], 1000 * 60 * 60 * 4 * 7, 0, true, nominatimTestJSON);
test.addTest('Time ranges spanning midnight', [
'We 22:00-22:00',
'We22:00-22:00',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.03 22:00', '2012.10.04 22:00' ],
], 1000 * 60 * 60 * 24, 0, true, {}, 'not last test');
test.addTest('Time ranges spanning midnight with date overwriting', [
'22:00-02:00; Tu 12:00-14:00',
'22:00-02:00; Tu12:00-14:00',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 00:00', '2012.10.01 02:00' ],
[ '2012.10.01 22:00', '2012.10.02 00:00' ],
[ '2012.10.02 12:00', '2012.10.02 14:00' ],
[ '2012.10.03 00:00', '2012.10.03 02:00' ],
[ '2012.10.03 22:00', '2012.10.04 02:00' ],
[ '2012.10.04 22:00', '2012.10.05 02:00' ],
[ '2012.10.05 22:00', '2012.10.06 02:00' ],
[ '2012.10.06 22:00', '2012.10.07 02:00' ],
[ '2012.10.07 22:00', '2012.10.08 00:00' ],
], 1000 * 60 * 60 * (6 * 4 + 2), 0, true, {}, 'not last test');
test.addTest('Time ranges spanning midnight with date overwriting (complex real world example)', [
'Su-Tu 11:00-01:00, We-Th 11:00-03:00, Fr 11:00-06:00, Sa 11:00-07:00',
'Su-Tu 11:00-01:00, We-Th11:00-03:00, Fr 11:00-06:00, Sa 11:00-07:00',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.01 00:00', '2012.10.01 01:00', ], // Mo: Su-Tu 11:00-01:00
[ '2012.10.01 11:00', '2012.10.02 01:00', ], // Mo: Su-Tu 11:00-01:00
[ '2012.10.02 11:00', '2012.10.03 01:00', ], // Tu: Su-Tu 11:00-01:00
[ '2012.10.03 11:00', '2012.10.04 03:00', ], // We: We-Th 11:00-03:00
[ '2012.10.04 11:00', '2012.10.05 03:00', ], // Th: We-Th 11:00-03:00
[ '2012.10.05 11:00', '2012.10.06 06:00', ], // Fr: Fr 11:00-06:00
[ '2012.10.06 11:00', '2012.10.07 07:00', ], // Sa: Sa 11:00-07:00
[ '2012.10.07 11:00', '2012.10.08 00:00', ], // Su: Su-Tu 11:00-01:00
], 1000 * 60 * 60 * (1 + 14 * 2 + 16 * 2 + 19 + 20 + 13), 0, true);
test.addTest('Time ranges spanning midnight (maximum supported)', [
'Tu 23:59-48:00',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.02 23:59', '2012.10.04 00:00' ],
], 1000 * 60 * (24 * 60 + 1), 0, true, {}, 'not last test');
test.addTest('Time ranges spanning midnight with open ened (maximum supported)', [
'Tu 23:59-40:00+',
// 'Tu 23:59-00:00 open, 24:00-40:00 open, 40:00+ open, 40:00+',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.02 23:59', '2012.10.03 16:00' ],
[ '2012.10.03 16:00', '2012.10.04 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * (16 * 60 + 1), 1000 * 60 * 60 * 8, true, {}, 'not only test');
// }}}
// }}}
// open end {{{
test.addTest('Open end', [
'07:00+ open "visit there website to know if they did already close"', // specified comments should not be overridden
'07:00+ unknown "visit there website to know if they did already close"', // will always interpreted as unknown
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 07:00', '2012.10.02 00:00', true, 'visit there website to know if they did already close' ],
], 0, 1000 * 60 * 60 * (24 - 7), true, {}, 'not last test');
test.addTest('Open end', [
'17:00+',
'17:00-late',
'17:00 til late',
'17:00 till late',
'17:00 bis Open End',
'17:00-open end',
// '17:00 – Open End', // '–' matches first.
'17:00-openend',
'17:00+; 15:00-16:00 off',
'15:00-16:00 off; 17:00+',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 00:00', '2012.10.01 03:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.01 17:00', '2012.10.02 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 0, 1000 * 60 * 60 * (3 + 24 - 17), true, nominatimTestJSON, 'not last test');
test.addTest('Open end, variable time', [
'sunrise+',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 07:22', '2012.10.02 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 0, 1000 * 60 * (60 * 16 + 60 - 22), false, nominatimTestJSON, 'not last test');
test.addTest('Open end, variable time', [
'(sunrise+01:00)+',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 08:22', '2012.10.02 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 0, 1000 * 60 * (60 * 15 + 60 - 22), false, nominatimTestJSON, 'not last test');
test.addTest('Open end', [
'17:00+ off',
'17:00+off',
'17:00-19:00 off',
], '2012.10.01 0:00', '2012.10.02 0:00', [
], 0, 0, true, {}, 'not last test');
test.addTest('Open end', [
// '12:00-16:00,07:00+', // Fails. This is ok. Just put your time selectors in the correct order.
'07:00+,12:00-16:00',
'07:00+,12:00-13:00,13:00-16:00',
'07:00+,12:00-16:00; 16:00-24:00 closed "needed because of open end"', // Now obsolete: https://github.com/opening-hours/opening_hours.js/issues/48
], '2012.10.01 0:00', '2012.10.02 5:00', [
[ '2012.10.01 07:00', '2012.10.01 12:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.01 12:00', '2012.10.01 16:00' ],
], 1000 * 60 * 60 * 4, 1000 * 60 * 60 * 5, true, {}, 'not only test');
test.addTest('Open end', [
'05:00-06:00,06:45-07:00+,13:00-16:00',
'06:45-07:00+,05:00-06:00,13:00-16:00',
'06:45-07:00+,05:00-06:00,13:00-14:00,14:00-16:00',
], '2012.10.01 0:00', '2012.10.02 5:00', [
[ '2012.10.01 05:00', '2012.10.01 06:00' ],
[ '2012.10.01 06:45', '2012.10.01 07:00' ],
[ '2012.10.01 07:00', '2012.10.01 13:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.01 13:00', '2012.10.01 16:00' ],
], 1000 * 60 * 60 * (4 + 0.25), 1000 * 60 * 60 * 6, true, {}, 'not only test');
/* To complicated, just don‘t use them … {{{ */
test.addTest('Open end', [
'17:00+,13:00-02:00; 02:00-03:00 closed "needed because of open end"',
'17:00+,13:00-02:00; 02:00-03:00 closed "needed because of open end"',
// '17:00-00:00 unknown "Specified as open end. Closing time was guessed.", 13:00-00:00 open' // First internal rule.
// + ', ' [> overwritten part: 00:00-03:00 open' <] + '00:00-02:00 open', // Second internal rule.
], '2012.10.01 0:00', '2012.10.02 5:00', [
[ '2012.10.01 00:00', '2012.10.01 02:00' ],
[ '2012.10.01 13:00', '2012.10.02 02:00' ],
], 1000 * 60 * 60 * (2 + 24 - 13 + 2), 0, true, {}, 'not only test');
test.addTest('Open end', [
'13:00-17:00+', // Use this.
'13:00-17:00,17:00+',
'13:00-02:00,17:00+', // Do not use.
'13:00-17:00 open, 17:00+'
], '2012.10.01 0:00', '2012.10.02 5:00', [
[ '2012.10.01 00:00', '2012.10.01 03:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.01 13:00', '2012.10.01 17:00' ],
[ '2012.10.01 17:00', '2012.10.02 03:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * 60 * 4, 1000 * 60 * 60 * (3 + (3+4+3)), true, {}, 'not only test');
test.addTest('Open end', [
// '05:00-06:00,17:00+,13:00-02:00',
// '05:00-06:00,13:00-02:00,17:00+',
], '2012.10.01 0:00', '2012.10.02 5:00', [
[ '2012.10.01 00:00', '2012.10.01 02:00' ],
[ '2012.10.01 05:00', '2012.10.01 06:00' ],
[ '2012.10.01 13:00', '2012.10.02 02:00' ],
], 1000 * 60 * 60 * (2 + 1 + (24 - 13 + 2)), 0, true, {}, 'not only test');
/* }}} */
// proposal: opening hours open end fixed time extension {{{
// https://wiki.openstreetmap.org/wiki/Proposed_features/opening_hours_open_end_fixed_time_extension
test.addTest('Fixed time followed by open end', [
'14:00-17:00+',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 00:00', '2012.10.01 03:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.01 14:00', '2012.10.01 17:00' ],
[ '2012.10.01 17:00', '2012.10.02 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * 60 * 3, 1000 * 60 * 60 * (3 + 7), true, {}, 'not last test');
test.addTest('Fixed time followed by open end, wrapping over midnight', [
'Mo 22:00-04:00+',
'Mo 22:00-28:00+',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 22:00', '2012.10.02 04:00' ],
[ '2012.10.02 04:00', '2012.10.02 12:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * 60 * 6, 1000 * 60 * 60 * 8, true, {}, 'not last test');
test.addTest('variable time range followed by open end', [
'14:00-sunset+',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 00:00', '2012.10.01 04:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.01 14:00', '2012.10.01 19:00' ],
[ '2012.10.01 19:00', '2012.10.02 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * 60 * 5, 1000 * 60 * 60 * (4 + 5), false, nominatimTestJSON, 'not last test');
test.addTest('variable time range followed by open end', [
'sunrise-14:00+',
'sunrise-14:00,14:00+', // Internally represented as two time selectors.
'sunrise-14:00 open, 14:00+',
], '2012.10.01 0:00', '2012.10.02 5:00', [
[ '2012.10.01 07:22', '2012.10.01 14:00' ],
[ '2012.10.01 14:00', '2012.10.02 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * (38 + 60 * 6), 1000 * 60 * 60 * 10, false, nominatimTestJSON, 'not only test');
test.addTest('variable time range followed by open end', [
'sunrise-(sunset+01:00)+',
'sunrise-(sunset+01:00)+; Su off',
], '2012.10.06 0:00', '2012.10.07 0:00', [
[ '2012.10.06 00:00', '2012.10.06 05:00', true, 'Specified as open end. Closing time was guessed.' ],
[ '2012.10.06 07:29', '2012.10.06 19:50' ],
[ '2012.10.06 19:50', '2012.10.07 00:00', true, 'Specified as open end. Closing time was guessed.' ],
], 1000 * 60 * (31 + (19 - 8) * 60 + 50), 1000 * 60 * (60 * 5 + 60 * 4 + 10), false, nominatimTestJSON, 'not last test');
test.addTest('variable time range followed by open end, day wrap and different states', [
'Fr 11:00-24:00+ open "geöffnet täglich von 11:00 Uhr bis tief in die Nacht"',
'Fr 11:00-24:00+ open"geöffnet täglich von 11:00 Uhr bis tief in die Nacht"',
'Fr 11:00-24:00+open "geöffnet täglich von 11:00 Uhr bis tief in die Nacht"',
'Fr 11:00-24:00+open"geöffnet täglich von 11:00 Uhr bis tief in die Nacht"',
'Fr11:00-24:00+open"geöffnet täglich von 11:00 Uhr bis tief in die Nacht"',
], '2012.10.01 0:00', '2012.10.08 0:00', [
[ '2012.10.05 11:00', '2012.10.06 00:00', false, 'geöffnet täglich von 11:00 Uhr bis tief in die Nacht' ],
[ '2012.10.06 00:00', '2012.10.06 08:00', true, 'geöffnet täglich von 11:00 Uhr bis tief in die Nacht' ],
], 1000 * 60 * 60 * 13, 1000 * 60 * 60 * 8, true, nominatimTestJSON, 'not last test');
// }}}
// }}}
// variable times {{{
test.addTest('Variable times e.g. dawn, dusk', [
'Mo dawn-dusk',
'dawn-dusk',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 06:50', '2012.10.01 19:32' ],
], 1000 * 60 * (60 * 12 + 10 + 32), 0, false, nominatimTestJSON, 'not last test');
test.addTest('Variable times e.g. sunrise, sunset', [
'Mo sunrise-sunset',
'sunrise-sunset',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 07:22', '2012.10.01 19:00' ],
], 1000 * 60 * (60 * 11 + 38), 0, false, nominatimTestJSON);
test.addTest('Variable times e.g. sunrise, sunset without coordinates (→ constant times)', [
'sunrise-sunset',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 06:00', '2012.10.01 18:00' ],
[ '2012.10.02 06:00', '2012.10.02 18:00' ],
], 1000 * 60 * 60 * 12 * 2, 0, true);
test.addTest('Variable times e.g. sunrise, sunset', [
'sunrise-sunset open "Beware of sunburn!"',
// 'sunrise-sunset closed "Beware of sunburn!"', // Not so intuitive I guess.
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 07:22', '2012.10.01 19:00', false, 'Beware of sunburn!' ],
], 1000 * 60 * (60 * 11 + 38), 0, false, nominatimTestJSON, 'not only test');
test.addTest('Variable times calculation without coordinates', [
'(sunrise+01:02)-(sunset-00:30)',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 07:02', '2012.10.01 17:30' ],
[ '2012.10.02 07:02', '2012.10.02 17:30' ],
], 1000 * 60 * (60 * 10 + 28) * 2, 0, true, {}, 'not last test');
test.addTest('Variable times e.g. dawn, dusk without coordinates (→ constant times)', [
'dawn-dusk',
'(dawn+00:00)-dusk', // testing variable time calculation, should not change time
'dawn-(dusk-00:00)',
'(dawn+00:00)-(dusk-00:00)',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 05:30', '2012.10.01 18:30' ],
[ '2012.10.02 05:30', '2012.10.02 18:30' ],
], 1000 * 60 * 60 * 13 * 2, 0, true);
test.addTest('Variable times e.g. sunrise, sunset over a few days', [
'sunrise-sunset', // If your timezone uses daylight saving times you will see a difference of around one hours between two days.
'daylight', // Throws a warning.
], '2012.10.01 0:00', '2012.10.04 0:00', [
[ '2012.10.01 07:22', '2012.10.01 19:00' ],
[ '2012.10.02 07:23', '2012.10.02 18:58' ],
[ '2012.10.03 07:25', '2012.10.03 18:56' ],
], 1000 * 60 * ((60 * 11 + 38) + (60 * 11 + 37 - 2) + (60 * 11 + 35 - 4)), 0, false, nominatimTestJSON, 'not only test');
test.addTest('Variable times calculation with coordinates', [
'(sunrise+02:00)-sunset',
], '2012.10.01 0:00', '2012.10.04 0:00', [
[ '2012.10.01 09:22', '2012.10.01 19:00' ],
[ '2012.10.02 09:23', '2012.10.02 18:58' ],
[ '2012.10.03 09:25', '2012.10.03 18:56' ],
], 1000 * 60 * ((60 * 11 + 38) + (60 * 11 + 37 - 2) + (60 * 11 + 35 - 4) - 60 * 2 * 3), 0, false, nominatimTestJSON, 'not last test');
test.addTest('Variable times which moves over fix end time', [
'sunrise-08:02',
], '2013.01.26 0:00', '2013.02.03 0:00', [
// [ '2013.01.26 08:03', '2013.01.26 08:02' ], // Ignored because it would be interpreted as time range spanning midnight
// [ '2013.01.27 08:02', '2013.01.27 08:02' ], // which is probably not what you want.
[ '2013.01.28 08:00', '2013.01.28 08:02' ],
[ '2013.01.29 07:59', '2013.01.29 08:02' ],
[ '2013.01.30 07:58', '2013.01.30 08:02' ],
[ '2013.01.31 07:56', '2013.01.31 08:02' ],
[ '2013.02.01 07:55', '2013.02.01 08:02' ],
[ '2013.02.02 07:54', '2013.02.02 08:02' ],
], 1000 * 60 * (6 * 2 + 1 + 2 + 4 + 5 + 6), 0, false, nominatimTestJSON);
test.addTest('Variable times which moves over fix end time', [
'sunrise-08:00',
], '2013.01.26 0:00', '2013.02.03 0:00', [
[ '2013.01.29 07:59', '2013.01.29 08:00' ],
[ '2013.01.30 07:58', '2013.01.30 08:00' ],
[ '2013.01.31 07:56', '2013.01.31 08:00' ],
[ '2013.02.01 07:55', '2013.02.01 08:00' ],
[ '2013.02.02 07:54', '2013.02.02 08:00' ],
], 1000 * 60 * (1 + 2 + 4 + 5 + 6), 0, false, nominatimTestJSON);
test.addTest('Variable times which moves over fix end time', [
'sunrise-07:58',
], '2013.01.26 0:00', '2013.02.03 0:00', [
[ '2013.01.31 07:56', '2013.01.31 07:58' ],
[ '2013.02.01 07:55', '2013.02.01 07:58' ],
[ '2013.02.02 07:54', '2013.02.02 07:58' ],
], 1000 * 60 * (2 + 3 + 4), 0, false, nominatimTestJSON);
test.addTest('Variable times which moves over fix end time', [
'sunrise-06:00',
], '2013.01.26 0:00', '2013.02.03 0:00', [
// Not open in range. Constant sunrise <= end time < from time
], 0, 0, false, nominatimTestJSON);
test.addTest('Variable times which moves over fix end time', [
'sunrise-05:59', // end time < constant time < from time
], '2013.01.26 0:00', '2013.01.28 0:00', [
[ '2013.01.26 00:00', '2013.01.26 05:59' ],
[ '2013.01.26 08:02', '2013.01.27 05:59' ],
[ '2013.01.27 08:00', '2013.01.28 00:00' ],
], 1000 * 60 * ((60 * 5 + 59) + (60 * 22 - 3) + (60 * 16)), 0, false, nominatimTestJSON, 'not last test');
test.addTest('Variable times which moves over fix end time', [
'sunrise-06:00', // from time < constant time <= end time
], '2013.04.15 0:00', '2013.04.19 0:00', [
[ '2013.04.17 05:59', '2013.04.17 06:00' ],
[ '2013.04.18 05:56', '2013.04.18 06:00' ],
], 1000 * 60 * (1 + 4), 0, false, nominatimTestJSON_sunrise_below_default);
test.addTest('Variable times which moves over fix end time', [
ignored('sunrise-05:59'), // from time < end time <= constant time
], '2013.04.13 0:00', '2013.04.19 0:00', [
[ 'something else', '' ],
], 1000 * 60 * 3, 0, false, nominatimTestJSON_sunrise_below_default, 'not last test');
test.addTest('Variable times spanning midnight', [
'sunset-sunrise',
'Mo-Su sunset-sunrise',
], '2012.10.01 0:00', '2012.10.03 0:00', [
[ '2012.10.01 00:00', '2012.10.01 07:22' ],
[ '2012.10.01 19:00', '2012.10.02 07:23' ],
[ '2012.10.02 18:58', '2012.10.03 00:00' ],
], 1000 * 60 * ((60 * 7 + 22) + (60 * (5 + 7) + 23) + (60 * 5 + 2)), 0, false, nominatimTestJSON, 'not last test');
test.addTest('Variable times spanning midnight', [
'sunset-sunrise',
'Mo-Su sunset-sunrise',
// '19:00-07:22 Mo-Su', // also works but is week stable
'Mo-Su sunset-07:22',
'Mo-Su 19:00-sunrise',
], '2012.10.01 0:00', '2012.10.02 0:00', [
[ '2012.10.01 00:00', '2012.10.01 07:22' ],
[ '2012.10.01 19:00', '2012.10.02 00:00' ],
], 1000 * 60 * ((60 * 7 + 22) + (60 * 5)), 0, false, nominatimTestJSON, 'not last test');
// }}}
// holidays {{{
test.addTest('Variable days: public holidays', [
'PH',
'holiday', // Throws a warning.
'holidays', // Throws a warning.
'public holidays', // Throws a warning.
'public holiday', // Throws a warning.
], '2013.01.01 0:00', '2015.01.01 0:00', [
[ '2013.01.01 00:00', '2013.01.02 00:00', false, 'Neujahrstag' ],
[ '2013.01.06 00:00', '2013.01.07 00:00', false, 'Heilige Drei Könige' ],
[ '2013.03.29 00:00', '2013.03.30 00:00', false, 'Karfreitag' ],
[ '2013.04.01 00:00', '2013.04.02 00:00', false, 'Ostermontag' ],
[ '2013.05.01 00:00', '2013.05.02 00:00', false, 'Tag der Arbeit' ],
[ '2013.05.09 00:00', '2013.05.10 00:00', false, 'Christi Himmelfahrt' ],
[ '2013.05.20 00:00', '2013.05.21 00:00', false, 'Pfingstmontag' ],
[ '2013.05.30 00:00', '2013.05.31 00:00', false, 'Fronleichnam' ],
[ '2013.10.03 00:00', '2013.10.04 00:00', false, 'Tag der Deutschen Einheit' ],
[ '2013.11.01 00:00', '2013.11.02 00:00', false, 'Allerheiligen' ],
[ '2013.12.25 00:00', '2013.12.26 00:00', false, '1. Weihnachtstag' ],
[ '2013.12.26 00:00', '2013.12.27 00:00', false, '2. Weihnachtstag' ],
[ '2014.01.01 00:00', '2014.01.02 00:00', false, 'Neujahrstag' ],
[ '2014.01.06 00:00', '2014.01.07 00:00', false, 'Heilige Drei Könige' ],
[ '2014.04.18 00:00', '2014.04.19 00:00', false, 'Karfreitag' ],
[ '2014.04.21 00:00', '2014.04.22 00:00', false, 'Ostermontag' ],
[ '2014.05.01 00:00', '2014.05.02 00:00', false, 'Tag der Arbeit' ],
[ '2014.05.29 00:00', '2014.05.30 00:00', false, 'Christi Himmelfahrt' ],
[ '2014.06.09 00:00', '2014.06.10 00:00', false, 'Pfingstmontag' ],
[ '2014.06.19 00:00', '2014.06.20 00:00', false, 'Fronleichnam' ],
[ '2014.10.03 00:00', '2014.10.04 00:00', false, 'Tag der Deutschen Einheit' ],
[ '2014.11.01 00:00', '2014.11.02 00:00', false, 'Allerheiligen' ],
[ '2014.12.25 00:00', '2014.12.26 00:00', false, '1. Weihnachtstag' ],
[ '2014.12.26 00:00', '2014.12.27 00:00', false, '2. Weihnachtstag' ],
], 1000 * 60 * 60 * 24 * (20 + 2 * 2), 0, false, nominatimTestJSON, 'not only test');
test.addTest('Variable days: public holidays', [
'open; PH off',
// 'PH off; 24/7', // should not be the same if following the rules
], '2013.04.01 0:00', '2013.05.11 0:00', [
[ '2013.04.02 00:00', '2013.05.01 00:00' ],
[ '2013.05.02 00:00', '2013.05.09 00:00' ],
[ '2013.05.10 00:00', '2013.05.11 00:00' ],
], 1000 * 60 * 60 * 24 * (30 - 1 + 7 + 1), 0, false, nominatimTestJSON, 'not last test');
test.addTest('Variable days: public holidays (with time range)', [
'PH 12:00-13:00',
], '2012.01.01 0:00', '2012.04.01 0:00', [
[ '2012.01.01 12:00', '2012.01.01 13:00', false, 'Neujahrstag' ],
[ '2012.01.06 12:00', '2012.01.06 13:00', false, 'Heilige Drei Könige' ],
], 1000 * 60 * 60 * 2, 0, false, nominatimTestJSON, 'not last test');
test.addTest('Variable days: public holidays (with time range)', [
'PH 12:00-13:00 open "this comment should override the holiday name which is returned as comment if PH matches."',
], '2012.01.01 0:00', '2012.04.01 0:00', [
[ '2012.01.01 12:00', '2012.01.01 13:00', false, 'this comment should override the holiday name which is returned as comment if PH matches.' ],
[ '2012.01.06 12:00', '2012.01.06 13:00', false, 'this comment should override the holiday name which is returned as comment if PH matches.' ],
], 1000 * 60 * 60 * 2, 0, false, nominatimTestJSON, 'not last test');
test.addTest('PH: Only if PH is Wednesday', [
'PH We,Fr',
'PH: We,Fr', // Please don’t use ":" after holiday.
' We,Fr: PH', // Please don’t use ":" after holiday.
], '2012.01.01 0:00', '2012.10.08 0:00', [
[ '2012.01.06 00:00', '2012.01.07 00:00', false, 'Heilige Drei Könige' ], // Fr
[ '2012.04.06 00:00', '2012.04.07 00:00', false, 'Karfreitag' ], // Fr
[ '2012.10.03 00:00', '2012.10.04 00:00', false, 'Tag der Deutschen Einheit' ], // We
], 1000 * 60 * 60 * 24 * 3, 0, false, nominatimTestJSON, 'not only test');
test.addTest('SH', [
'SH Mo-Fr',
'Schulferien Mo-Fr',
'Ferien Mo-Fr',
'schoolholiday Mo-Fr',
'school holiday Mo-Fr',
'school holidays Mo-Fr',
'SH: Mo-Fr', // Please don’t use ":" after holiday.
'SH on work day',
'SH on work days',
], '2012.12.22 0:00', '2013.01.08 0:00', [
[ '2012.12.24 00:00', '2012.12.29 00:00', false, 'Weihnachtsferien' ],
[ '2012.12.31 00:00', '2013.01.05 00:00', false, 'Weihnachtsferien' ],
], 1000 * 60 * 60 * 24 * (5 * 2), 0, false, nominatimTestJSON, 'not only test');
test.addTest('SH', [
'SH Mo-Fr',
], '2012.12.22 0:00', '2013.01.08 0:00', [
[ '2012.12.24 00:00', '2012.12.29 00:00', false, 'Weihnachtsferien' ],
[ '2012.12.31 00:00', '2013.01.05 00:00', false, 'Weihnachtsferien' ],
], 1000 * 60 * 60 * 24 * (5 * 2), 0, false, null, 'not only test');
test.addTest('Variable days: public holidays', [
'PH +1 day',