bus-mj 1.2.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -45
- package/data/nodes.js +2293 -0
- package/data/relations.js +5387 -0
- package/index.d.ts +39 -14
- package/index.js +22 -3
- package/package.json +1 -1
- package/src/getBus.js +106 -53
- package/data/bus.js +0 -124
- package/src/stop.js +0 -33
package/README.md
CHANGED
|
@@ -8,91 +8,262 @@
|
|
|
8
8
|
|
|
9
9
|
#### Hialana @ tsy fahafantarana ny "arret" tokony ialana
|
|
10
10
|
|
|
11
|
-
#### Ahitana ny:
|
|
12
|
-
- "point de depart" sy "point d'arrivee"
|
|
13
|
-
- distance entre "deux point"
|
|
14
|
-
- temps de circulation
|
|
15
|
-
- ...
|
|
16
|
-
|
|
17
11
|
## <u> import </u>:
|
|
18
12
|
|
|
19
13
|
```js
|
|
20
|
-
|
|
14
|
+
import {
|
|
15
|
+
findBusAll,
|
|
16
|
+
findStopAll,
|
|
17
|
+
findBusDetailById,
|
|
18
|
+
findBusByOneStop,
|
|
19
|
+
findBusByTwoStop
|
|
20
|
+
} from "bus-mj";
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## <u> usage </u>:
|
|
24
24
|
|
|
25
25
|
- List Bus
|
|
26
|
+
|
|
26
27
|
```js
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
// maka ny lisitry ny bus rehetra
|
|
29
|
+
console.log( findBusAll() );
|
|
29
30
|
```
|
|
31
|
+
|
|
30
32
|
```typescript
|
|
31
|
-
|
|
33
|
+
// result
|
|
34
|
+
[
|
|
32
35
|
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
type: "relation",
|
|
37
|
+
id: 16057683,
|
|
38
|
+
members: [
|
|
39
|
+
{
|
|
40
|
+
type: "node",
|
|
41
|
+
id: 6450569024,
|
|
42
|
+
lat: -15.7066094,
|
|
43
|
+
lon: 46.3855679,
|
|
44
|
+
label: "Imaintsoanala",
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "node",
|
|
48
|
+
id: 2006531160,
|
|
49
|
+
lat: -15.706214,
|
|
50
|
+
lon: 46.3799647,
|
|
51
|
+
label: "Abad",
|
|
52
|
+
},
|
|
53
|
+
...
|
|
54
|
+
{
|
|
55
|
+
type: "node",
|
|
56
|
+
id: 11027750469,
|
|
57
|
+
lat: -15.7065943,
|
|
58
|
+
lon: 46.3854314,
|
|
59
|
+
label: "Arret 18",
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
tags: {
|
|
63
|
+
colour: "orange",
|
|
64
|
+
fee: "yes",
|
|
65
|
+
from: "Belobaka",
|
|
66
|
+
name: "Ligne 7 Plaque Mena",
|
|
67
|
+
network: "Zone Urbaine",
|
|
68
|
+
opening_hours: "Mo-Su 04:00-22:00",
|
|
69
|
+
operator: "MAMI",
|
|
70
|
+
"public_transport:version": "2",
|
|
71
|
+
ref: "7",
|
|
72
|
+
route: "bus",
|
|
73
|
+
to: "Belobaka",
|
|
74
|
+
type: "route",
|
|
37
75
|
},
|
|
38
|
-
|
|
39
|
-
|
|
76
|
+
},
|
|
77
|
+
...
|
|
78
|
+
];
|
|
40
79
|
```
|
|
41
80
|
|
|
42
81
|
- List Stops
|
|
82
|
+
|
|
43
83
|
```js
|
|
44
|
-
|
|
45
|
-
|
|
84
|
+
// maka ny lisitry ny arret bus rehetra
|
|
85
|
+
console.log( findStopAll() );
|
|
46
86
|
```
|
|
87
|
+
|
|
47
88
|
```typescript
|
|
48
89
|
// result
|
|
49
90
|
[
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
91
|
+
{
|
|
92
|
+
type: 'node',
|
|
93
|
+
id: 6450569024,
|
|
94
|
+
lat: -15.7066094,
|
|
95
|
+
lon: 46.3855679,
|
|
96
|
+
label: 'Imaintsoanala'
|
|
97
|
+
},
|
|
53
98
|
...
|
|
54
99
|
]
|
|
55
100
|
```
|
|
56
101
|
|
|
57
|
-
- Get
|
|
102
|
+
- Get Bus detail
|
|
103
|
+
|
|
58
104
|
```js
|
|
59
|
-
|
|
60
|
-
|
|
105
|
+
// maka ny mombamomba ny bus iray
|
|
106
|
+
console.log( findBusDetailById( 16057683 ) );
|
|
61
107
|
```
|
|
108
|
+
|
|
62
109
|
```typescript
|
|
63
110
|
// result
|
|
64
|
-
|
|
111
|
+
{
|
|
112
|
+
type: "relation",
|
|
113
|
+
id: 16057683,
|
|
114
|
+
members: [
|
|
115
|
+
{
|
|
116
|
+
type: "node",
|
|
117
|
+
id: 6450569024,
|
|
118
|
+
lat: -15.7066094,
|
|
119
|
+
lon: 46.3855679,
|
|
120
|
+
label: "Imaintsoanala",
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
type: "node",
|
|
124
|
+
id: 2006531160,
|
|
125
|
+
lat: -15.706214,
|
|
126
|
+
lon: 46.3799647,
|
|
127
|
+
label: "Abad",
|
|
128
|
+
},
|
|
129
|
+
...
|
|
130
|
+
{
|
|
131
|
+
type: "node",
|
|
132
|
+
id: 11027750469,
|
|
133
|
+
lat: -15.7065943,
|
|
134
|
+
lon: 46.3854314,
|
|
135
|
+
label: "Arret 18",
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
tags: {
|
|
139
|
+
colour: "orange",
|
|
140
|
+
fee: "yes",
|
|
141
|
+
from: "Belobaka",
|
|
142
|
+
name: "Ligne 7 Plaque Mena",
|
|
143
|
+
network: "Zone Urbaine",
|
|
144
|
+
opening_hours: "Mo-Su 04:00-22:00",
|
|
145
|
+
operator: "MAMI",
|
|
146
|
+
"public_transport:version": "2",
|
|
147
|
+
ref: "7",
|
|
148
|
+
route: "bus",
|
|
149
|
+
to: "Belobaka",
|
|
150
|
+
type: "route",
|
|
151
|
+
},
|
|
152
|
+
}
|
|
65
153
|
```
|
|
66
154
|
|
|
67
|
-
-
|
|
155
|
+
- Find The Right Bus of one stop
|
|
156
|
+
|
|
68
157
|
```js
|
|
69
|
-
|
|
70
|
-
|
|
158
|
+
// maka ny lisitry ny bus mandalo @ arret iray
|
|
159
|
+
// ex: 2006531160 - arret bus Abad (Sotema)
|
|
160
|
+
console.log( findBusByOneStop( 2006531160 ) );
|
|
71
161
|
```
|
|
162
|
+
|
|
72
163
|
```typescript
|
|
73
|
-
|
|
74
|
-
|
|
164
|
+
// result
|
|
165
|
+
[
|
|
166
|
+
{
|
|
167
|
+
type: "relation",
|
|
168
|
+
id: 16057683,
|
|
169
|
+
members: [
|
|
170
|
+
{
|
|
171
|
+
type: "node",
|
|
172
|
+
id: 6450569024,
|
|
173
|
+
lat: -15.7066094,
|
|
174
|
+
lon: 46.3855679,
|
|
175
|
+
label: "Imaintsoanala",
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: "node",
|
|
179
|
+
id: 2006531160,
|
|
180
|
+
lat: -15.706214,
|
|
181
|
+
lon: 46.3799647,
|
|
182
|
+
label: "Abad",
|
|
183
|
+
},
|
|
184
|
+
...
|
|
185
|
+
{
|
|
186
|
+
type: "node",
|
|
187
|
+
id: 11027750469,
|
|
188
|
+
lat: -15.7065943,
|
|
189
|
+
lon: 46.3854314,
|
|
190
|
+
label: "Arret 18",
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
tags: {
|
|
194
|
+
colour: "orange",
|
|
195
|
+
fee: "yes",
|
|
196
|
+
from: "Belobaka",
|
|
197
|
+
name: "Ligne 7 Plaque Mena",
|
|
198
|
+
network: "Zone Urbaine",
|
|
199
|
+
opening_hours: "Mo-Su 04:00-22:00",
|
|
200
|
+
operator: "MAMI",
|
|
201
|
+
"public_transport:version": "2",
|
|
202
|
+
ref: "7",
|
|
203
|
+
route: "bus",
|
|
204
|
+
to: "Belobaka",
|
|
205
|
+
type: "route",
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
...
|
|
209
|
+
];
|
|
75
210
|
```
|
|
76
211
|
|
|
77
|
-
|
|
212
|
+
|
|
213
|
+
- Find The Right Bus of 2 stops
|
|
214
|
+
|
|
78
215
|
```js
|
|
79
|
-
|
|
80
|
-
|
|
216
|
+
// maka ny lisitry ny bus mandalo @ arret roa
|
|
217
|
+
// ex1: 2006531160 - arret bus Abad (Sotema)
|
|
218
|
+
// ex2: 11029976167 - arret bus Bord (Majunga be)
|
|
219
|
+
console.log( findBusByTwoStop( 2006531160, 11029976167 ) );
|
|
81
220
|
```
|
|
221
|
+
|
|
82
222
|
```typescript
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
223
|
+
// result
|
|
224
|
+
[
|
|
225
|
+
{
|
|
226
|
+
type: "relation",
|
|
227
|
+
id: 16057683,
|
|
228
|
+
members: [
|
|
229
|
+
...
|
|
230
|
+
{
|
|
231
|
+
type: "node",
|
|
232
|
+
id: 2006531160,
|
|
233
|
+
lat: -15.706214,
|
|
234
|
+
lon: 46.3799647,
|
|
235
|
+
label: "Abad",
|
|
236
|
+
},
|
|
237
|
+
...
|
|
238
|
+
{
|
|
239
|
+
type: 'node',
|
|
240
|
+
id: 11029976167,
|
|
241
|
+
lat: -15.7211965,
|
|
242
|
+
lon: 46.3047163,
|
|
243
|
+
label: 'Bord'
|
|
244
|
+
},
|
|
245
|
+
...
|
|
246
|
+
],
|
|
247
|
+
tags: {
|
|
248
|
+
colour: "orange",
|
|
249
|
+
fee: "yes",
|
|
250
|
+
from: "Belobaka",
|
|
251
|
+
name: "Ligne 7 Plaque Mena",
|
|
252
|
+
network: "Zone Urbaine",
|
|
253
|
+
opening_hours: "Mo-Su 04:00-22:00",
|
|
254
|
+
operator: "MAMI",
|
|
255
|
+
"public_transport:version": "2",
|
|
256
|
+
ref: "7",
|
|
257
|
+
route: "bus",
|
|
258
|
+
to: "Belobaka",
|
|
259
|
+
type: "route",
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
...
|
|
263
|
+
];
|
|
88
264
|
```
|
|
89
265
|
|
|
90
266
|
## <u> Mbola hanampiana azy </u>:
|
|
91
267
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
+ longeur
|
|
95
|
-
+ ireo arret ao anaty ny fokotany irray
|
|
96
|
-
+ mamatatra ny hoe mbola miasa ve io bus io @zao (maka ny heure actuel)
|
|
97
|
-
+ mifindra BUS raha tokony hifindra rehefa tonga @arret iray (Oh: belobaka vers petit plage)
|
|
98
|
-
+ ...
|
|
268
|
+
- fanavahana ireo arret bus rehetra ao anaty ny fokotany iray
|
|
269
|
+
- fifindrana bus raha toa ka tsy misy bus mivantana amin'ny arret roa (02). Oh: belobaka - petit plage => [ ligne 7 mifindra ligne 12 na ligne 15 ]
|