-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
95 lines (92 loc) · 1.99 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
var test = require('tape'),
findExtract = require('./'),
fs = require('fs');
var geofabrik = JSON.parse(fs.readFileSync('geofabrik.geojson', 'utf8'));
test('findExtract', function(t){
t.equals(findExtract(testdata.features[1], geofabrik), 'europe/austria');
t.equals(findExtract(testdata.features[0], geofabrik), 'europe/alps');
t.end();
});
var testdata = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"name": "Bodensee"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
9.25048828125,
47.57281986733871
],
[
8.84674072265625,
47.667237034505156
],
[
9.03076171875,
47.85924575819688
],
[
9.525146484375,
47.657987988142274
],
[
9.865722656249998,
47.635783590864854
],
[
9.876708984375,
47.428087261714275
],
[
9.580078125,
47.37603463349758
],
[
9.25048828125,
47.57281986733871
]
]
]
}
},
{
"type": "Feature",
"properties": {
"name": "Graz"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
15.3369140625,
46.99524110694596
],
[
15.3369140625,
47.15236927446393
],
[
15.534667968749998,
47.15236927446393
],
[
15.534667968749998,
46.99524110694596
],
[
15.3369140625,
46.99524110694596
]
]
]
}
}
]
}