-
Notifications
You must be signed in to change notification settings - Fork 0
/
vehicles.json
387 lines (387 loc) · 11.3 KB
/
vehicles.json
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
{
"$id": "https://raw.githubusercontent.com/openmobilityfoundation/mobility-data-specification/master/provider/dockless/vehicles.json",
"$schema": "http://json-schema.org/draft-06/schema#",
"title": "The MDS Provider Schema, vehicles payload",
"type": "object",
"definitions": {
"Point": {
"$id": "#/definitions/Point",
"title": "GeoJSON Point",
"type": "object",
"required": [
"type",
"coordinates"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Point"
]
},
"coordinates": {
"type": "array",
"minItems": 2,
"items": [
{
"type": "number",
"minimum": -180.0,
"maximum": 180.0
},
{
"type": "number",
"minimum": -90.0,
"maximum": 90.0
}
],
"maxItems": 2
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
"MDS_Feature_Point": {
"$id": "#/definitions/MDS_Feature_Point",
"title": "MDS GeoJSON Feature Point",
"type": "object",
"required": [
"type",
"properties",
"geometry"
],
"properties": {
"type": {
"type": "string",
"enum": [
"Feature"
]
},
"properties": {
"type": "object",
"required": [
"timestamp"
],
"properties": {
"timestamp": {
"$ref": "#/definitions/timestamp"
}
}
},
"geometry": {
"$ref": "#/definitions/Point"
},
"bbox": {
"type": "array",
"minItems": 4,
"items": {
"type": "number"
}
}
}
},
"links": {
"$id": "#/definitions/links",
"type": "object",
"required": [
"next"
],
"properties": {
"first": {
"$id": "#/definitions/links/first",
"type": [
"null",
"string"
],
"title": "The URL to the first page of data",
"examples": [
"https://data.provider.co/trips/first"
],
"format": "uri"
},
"last": {
"$id": "#/definitions/links/last",
"type": [
"null",
"string"
],
"title": "The URL to the last page of data",
"examples": [
"https://data.provider.co/trips/last"
],
"format": "uri"
},
"prev": {
"$id": "#/definitions/links/prev",
"type": [
"null",
"string"
],
"title": "The URL to the previous page of data",
"examples": [
"https://data.provider.co/trips/prev"
],
"format": "uri"
},
"next": {
"$id": "#/definitions/links/next",
"type": [
"null",
"string"
],
"title": "The URL to the next page of data",
"examples": [
"https://data.provider.co/trips/next"
],
"format": "uri",
"pattern": "^(.*)$"
}
},
"additionalProperties": false
},
"propulsion_type": {
"$id": "#/definitions/propulsion_type",
"type": "array",
"description": "The type of propulsion; allows multiple values",
"items": {
"type": "string",
"enum": [
"combustion",
"electric",
"electric_assist",
"human"
]
},
"minItems": 1
},
"timestamp": {
"$id": "#/definitions/timestamp",
"title": "Integer milliseconds since Unix epoch",
"type": "number",
"multipleOf": 1.0,
"minimum": 0
},
"vehicle_type": {
"$id": "#/definitions/vehicle_type",
"type": "string",
"description": "The type of vehicle",
"enum": [
"bicycle",
"car",
"scooter",
"moped"
]
},
"version": {
"$id": "#/definitions/version",
"type": "string",
"title": "The MDS Provider version this data represents",
"examples": [
"0.4.0"
],
"pattern": "^0\\.4\\.[0-9]+$"
},
"uuid": {
"$id": "#/definitions/uuid",
"type": "string",
"title": "A UUID used to uniquely identifty an object",
"default": "",
"examples": [
"3c9604d6-b5ee-11e8-96f8-529269fb1459"
],
"pattern": "^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$"
}
},
"required": [
"version",
"data",
"last_updated",
"ttl"
],
"properties": {
"version": {
"$id": "#/properties/version",
"$ref": "#/definitions/version"
},
"data": {
"$id": "#/properties/data",
"type": "object",
"title": "The page of data",
"required": [
"vehicles"
],
"properties": {
"vehicles": {
"$id": "#/properties/data/properties/vehicles",
"type": "array",
"title": "The vehicles payload",
"items": {
"$id": "#/properties/data/properties/vehicles/items",
"type": "object",
"title": "The vehicle item schema",
"required": [
"provider_name",
"provider_id",
"device_id",
"vehicle_id",
"vehicle_type",
"propulsion_type",
"last_event_time",
"last_event_type",
"last_event_type_reason",
"last_event_location"
],
"properties": {
"provider_name": {
"$id": "#/properties/data/properties/vehicles/items/properties/provider_name",
"type": "string",
"description": "The public-facing name of the Provider",
"examples": [
"Provider Name"
],
"pattern": "^(.*)$"
},
"provider_id": {
"$id": "#/properties/data/properties/vehicles/items/properties/provider_id",
"description": "The UUID for the Provider, unique within MDS",
"$ref": "#/definitions/uuid"
},
"device_id": {
"$id": "#/properties/data/properties/vehicles/items/properties/device_id",
"description": "A unique device ID in UUID format",
"$ref": "#/definitions/uuid"
},
"vehicle_id": {
"$id": "#/properties/data/properties/vehicles/items/properties/vehicle_id",
"type": "string",
"description": "The Vehicle Identification Number visible on the vehicle itself",
"default": "",
"examples": [
"ABC123"
],
"pattern": "^(.*)$"
},
"vehicle_type": {
"$id": "#/properties/data/properties/vehicles/items/properties/vehicle_type",
"$ref": "#/definitions/vehicle_type",
"description": "The type of vehicle"
},
"propulsion_type": {
"$id": "#/properties/data/properties/vehicles/items/properties/propulsion_type",
"description": "The type of propulsion; allows multiple values",
"$ref": "#/definitions/propulsion_type"
},
"last_event_time": {
"$id": "#/properties/data/properties/vehicles/items/properties/last_event_time",
"description": "The time the most recent status change event occurred, expressed as a Unix Timestamp",
"$ref": "#/definitions/timestamp"
},
"last_event_type": {
"type": "string",
"description": "The type of the event"
},
"last_event_type_reason": {
"type": "string",
"description": "The reason for the event"
},
"last_event_location": {
"$id": "#/properties/data/properties/vehicles/items/properties/last_event_location",
"description": "Location of the vehicle's last status change event",
"$ref": "#/definitions/MDS_Feature_Point"
},
"current_location": {
"$id": "#/properties/data/properties/vehicles/items/properties/current_location",
"description": "Current location of vehicle if different from last event, and the vehicle is not currently on a trip",
"$ref": "#/definitions/MDS_Feature_Point"
},
"battery_pct": {
"$id": "#/properties/data/properties/vehicles/items/properties/battery_pct",
"type": [
"number",
"null"
],
"description": "Percent charge of device battery, expressed between 0 and 1",
"examples": [
0.89
],
"minimum": 0,
"maximum": 1
}
},
"oneOf": [
{
"properties": {
"last_event_type": {
"enum": [
"available"
]
},
"last_event_type_reason": {
"enum": [
"service_start",
"user_drop_off",
"rebalance_drop_off",
"maintenance_drop_off",
"agency_drop_off"
]
}
}
},
{
"properties": {
"last_event_type": {
"enum": [
"reserved"
]
},
"last_event_type_reason": {
"enum": [
"user_pick_up"
]
}
}
},
{
"properties": {
"last_event_type": {
"enum": [
"unavailable"
]
},
"last_event_type_reason": {
"enum": [
"low_battery",
"maintenance"
]
}
}
}
]
}
}
},
"additionalProperties": false
},
"links": {
"$id": "#/properties/links",
"$ref": "#/definitions/links"
},
"last_updated": {
"$id": "#/properties/last_updated",
"description": "Timestamp indicating the last time the data in this feed was updated",
"$ref": "#/definitions/timestamp"
},
"ttl": {
"$id": "#/properties/ttl",
"type": "integer",
"title": "Integer representing the number of milliseconds before the data in this feed will be updated again (0 if the data should always be refreshed)",
"minimum": 0,
"maximum": 300000
}
},
"additionalProperties": false
}