forked from hove-io/navitia-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse.proto
670 lines (564 loc) · 17.9 KB
/
response.proto
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
syntax = "proto2";
import "type.proto";
package pbnavitia;
enum CyclePathType {
NoCycleLane = 0;
SharedCycleWay = 1; // Shared use lane (could be shared with pedestrians)
DedicatedCycleWay = 2; // Dedicated cycle lane
SeparatedCycleWay = 3; // A separate cycle lane (physical separation from the main carriageway
}
message PathItem {
optional string name = 1;
optional double length = 2;
optional int32 direction = 3;
optional double duration = 4;
optional CyclePathType cycle_path_type = 5;
optional int32 id = 6;
optional GeographicalCoord coordinate = 7;
optional string instruction = 8;
optional GeographicalCoord instruction_start_coordinate = 9;
optional string via_uri = 10;
}
message StreetInformation {
optional int32 geojson_offset = 1;
optional CyclePathType cycle_path_type = 2;
optional double length = 3;
}
message DynamicSpeed {
optional float base_speed = 1;
optional float traffic_speed = 2;
optional int32 geojson_offset = 3;
}
enum StreetNetworkMode {
Walking = 0;
Bike = 1;
Car = 3;
Bss = 4;
Ridesharing = 5;
CarNoPark = 6;
Taxi = 7;
}
message StreetNetwork {
optional double length = 1;
optional double duration = 2;
optional StreetNetworkMode mode = 3;
repeated PathItem path_items = 4;
repeated GeographicalCoord coordinates = 5;
repeated Elevation elevations = 6;
repeated DynamicSpeed dynamic_speeds = 7;
repeated StreetInformation street_information = 8;
}
enum SectionType {
PUBLIC_TRANSPORT = 1;
STREET_NETWORK = 2;
WAITING = 3;
TRANSFER = 4;
boarding = 6;
landing = 7;
BSS_RENT = 8;
BSS_PUT_BACK = 9;
CROW_FLY = 10;
PARK = 11;
LEAVE_PARKING = 12;
ALIGHTING = 13;
RIDESHARING = 14;
ON_DEMAND_TRANSPORT = 15;
}
enum TransferType {
walking = 1;
stay_in = 3;
}
message PtDisplayInfo {
optional string network = 1;
optional string code = 2;
optional string headsign = 3;
optional string direction = 4;
optional string color = 5;
optional string commercial_mode = 6;
optional string physical_mode = 7;
optional string description = 8;
optional Uris uris = 9;
optional hasEquipments has_equipments = 11;
optional string name = 12;
repeated Message messages = 13;
repeated string impact_uris = 18;
repeated Note notes = 15;
repeated string headsigns = 16;
optional string text_color = 17;
optional string trip_short_name = 19;
}
message Uris {
optional string company = 1;
optional string vehicle_journey = 2;
optional string line = 3;
optional string route = 4;
optional string commercial_mode = 5;
optional string physical_mode = 6;
optional string network = 7;
optional string note = 8;
optional string journey_pattern = 9;
optional string stop_area = 10; // Main direction uri
}
message Cost {
optional double value = 1;
optional string currency = 2;
}
message Ticket {
optional string id = 1;
optional string name = 2;
optional Cost cost = 3;
repeated string section_id = 4;
optional bool found = 5;
optional string comment = 6;
optional string source_id = 7;
}
message Fare {
optional Cost total = 1;
repeated string ticket_id = 2;
optional bool found = 3;
}
message Co2Emission {
optional double value = 1;
optional string unit = 2;
}
message PollutantValues {
optional double nox = 1;
optional double pm10 = 2;
}
message AirPollutants {
optional PollutantValues values = 1;
optional string unit = 2;
}
message LowEmissionZone {
optional bool on_path = 1;
}
message Durations {
optional int32 total = 1;
optional int32 walking = 2;
optional int32 bike = 3;
optional int32 car = 4;
optional int32 ridesharing = 5;
optional int32 taxi = 6;
}
message Distances {
optional int32 walking = 1;
optional int32 bike = 2;
optional int32 car = 3;
optional int32 ridesharing = 4;
optional int32 taxi = 5;
}
enum SectionAdditionalInformationType {
ODT_WITH_ZONE = 1;
ODT_WITH_STOP_POINT = 2;
ODT_WITH_STOP_TIME = 3;
HAS_DATETIME_ESTIMATED = 4;
REGULAR = 5;
STAY_IN = 6;
}
enum GenderType {
FEMALE = 1;
MALE = 2;
}
message IndividualRating {
optional double value = 1;
optional uint32 count = 2;
optional double scale_min = 3;
optional double scale_max = 4 ;
}
message IndividualInformation {
optional string alias = 1;
optional string image = 2;
optional GenderType gender = 3;
optional IndividualRating rating = 4;
}
message SeatsDescription {
optional uint32 total = 1;
optional uint32 available = 2;
}
message ExternalLink{
optional string key = 1;
optional string href = 2;
}
message RidesharingInformation {
optional string operator = 1;
optional string network = 2;
optional IndividualInformation driver = 3;
optional SeatsDescription seats = 4;
repeated ExternalLink links = 5;
}
message FeedPublisher{
required string id = 1;
optional string name = 2;
optional string url = 3;
optional string license = 4;
}
enum BoardingPosition {
FRONT = 1;
MIDDLE = 2;
BACK = 3;
}
message Section {
optional SectionType type = 1;
optional PtObject origin = 2;
optional PtObject destination = 3;
// Si c'est du TC
optional PtDisplayInfo pt_display_informations = 4;
optional Uris uris = 5;
optional VehicleJourney vehicle_journey = 9;
repeated StopDateTime stop_date_times = 10;
// Si c'est du routier
optional StreetNetwork street_network = 12;
optional int32 cycle_lane_length = 30;
// Si c'est de l'attente
optional TransferType transfer_type = 13;
// If it is crowfly ridesharing (top-level)
repeated Journey ridesharing_journeys = 28;
// If it is ridesharing section (low-level)
optional RidesharingInformation ridesharing_information = 29;
// Dans tous les cas
repeated GeographicalCoord shape = 24;
optional int32 duration = 15;
optional uint64 begin_date_time = 16;
optional uint64 end_date_time = 17;
optional uint64 base_begin_date_time = 25;
optional uint64 base_end_date_time = 26;
optional RTLevel realtime_level = 27;
optional int32 length = 19;
optional string id = 20;
optional Co2Emission co2_emission = 21;
repeated SectionAdditionalInformationType additional_informations = 22;
// via which Entrance/Exit
repeated AccessPoint vias = 31;
optional AirPollutants air_pollutants = 32;
optional LowEmissionZone low_emission_zone = 33;
repeated BoardingPosition best_boarding_positions = 34;
}
message Journey {
//TODO: to be deleted after implemenation of durations
optional int32 duration = 1;
optional int32 nb_transfers = 2;
optional uint64 departure_date_time = 3;
optional uint64 arrival_date_time = 4;
optional uint64 requested_date_time = 5;
repeated Section sections = 6;
optional PtObject origin = 7;
optional PtObject destination = 8;
optional string type = 9; // for jormungandr only
optional Fare fare = 10;
repeated string tags = 11; //for jormungandr only
repeated Calendar calendars = 12;
optional Co2Emission co2_emission = 13;
optional string most_serious_disruption_effect = 14; // actually contains the journey effect (see doc on journey status)
optional string internal_id = 15; //for jormungandr only. for log purpose we add an id to the journey
// for debug purpose we store some journey internal indicators
optional uint64 sn_dur = 16;
optional uint64 transfer_dur = 17;
optional uint64 min_waiting_dur = 18;
optional uint32 nb_vj_extentions = 19;
optional uint32 nb_sections = 20;
optional Durations durations = 21;
optional Distances distances = 22;
optional AirPollutants air_pollutants = 23;
optional LowEmissionZone low_emission_zone = 24;
}
message PtJourneyFare {
optional string journey_id = 1; // linking to request.PtJourney.id from input
optional Fare fare = 2;
}
enum ResponseType {
ITINERARY_FOUND = 1;
DATE_OUT_OF_BOUNDS = 2;
NO_ORIGIN_POINT = 3;
NO_DESTINATION_POINT = 4;
NO_ORIGIN_NOR_DESTINATION_POINT = 5;
NO_VIA_POINT = 6;
NO_SOLUTION = 7;
CONNECTION_LIMITATION = 8;
DURATION_LIMITATION = 9;
}
message Planner {
repeated Journey journeys = 1;
optional ResponseType response_type = 2;
optional string before = 3;
optional string after = 4;
}
message GeoStatus{
optional string street_network_source = 1;
optional int32 nb_admins = 2;
optional int32 nb_admins_from_cities = 3;
optional int32 nb_ways = 4;
optional int32 nb_addresses = 5;
optional int32 nb_poi = 6;
optional string poi_source = 7;
}
message Status{
required string publication_date = 1;
required string start_production_date = 2;
required string end_production_date = 3;
optional int32 data_version = 4;
optional string navitia_version = 6;
repeated string data_sources = 7;
optional string last_load_at = 8;
optional bool last_load_status = 9;
optional bool loaded = 10;
optional int32 nb_threads = 11;
optional bool is_connected_to_rabbitmq = 12;
optional string status = 13;
optional string last_rt_data_loaded = 14;
optional bool is_realtime_loaded = 16;
optional string dataset_created_at = 17;
repeated string rt_contributors = 18;
optional bool disruption_error = 19;
}
message ScheduleStopTime {
optional Properties properties = 2;
// date time is split because sometimes
// we want only time and no dates for the schedule
// Note: to define a null schedule time, time must be equal to it's max value (max uint64 value)
optional uint64 time = 3; //time is the number of seconds since midnight
optional uint64 date = 4; //date is a posix time stamp to midnight
optional ResponseStatus dt_status = 5;
optional RTLevel realtime_level = 6;
optional uint64 base_date_time = 7;
repeated string impact_uris = 8;
optional string occupancy = 9; // occupancy status as described in https://gtfs.org/reference/realtime/v2/#enum-occupancystatus
}
message RouteScheduleRow {
required StopPoint stop_point = 1;
repeated ScheduleStopTime date_times = 2;
repeated string stop_times = 3;
}
message Header{
required PtDisplayInfo pt_display_informations = 1;
repeated SectionAdditionalInformationType additional_informations = 3;
}
message Table {
repeated RouteScheduleRow rows = 1;
repeated Header headers = 2;
}
message RouteSchedule {
required Table table = 1;
required PtDisplayInfo pt_display_informations = 2;
optional MultiLineString geojson = 3;
optional ResponseStatus response_status = 4;
}
message Passage {
required StopDateTime stop_date_time = 1;
required StopPoint stop_point = 2;
optional PtDisplayInfo pt_display_informations = 3;
optional Route route = 4;
}
message RoutePoint {
optional Route route = 1;
optional StopPoint stop_point = 2;
optional PtDisplayInfo pt_display_informations = 3;
}
message BoardItem {
required string hour =1;
repeated string minutes = 2;
}
message DepartureBoard {
required StopPoint stop_point = 1;
required Route route = 2;
repeated BoardItem board_items = 3;
}
message Load {
required bool ok = 1;
}
message Metadatas {
required string start_production_date = 1;
required string end_production_date = 2;
required string shape = 3;
required string status = 4;
repeated string contributors = 12;
optional string timezone = 13;
optional string name = 14;
optional uint64 last_load_at = 15;
optional string dataset_created_at = 16;
}
message Pagination {
required int32 totalResult = 1;
required int32 startPage = 2;
required int32 itemsPerPage = 3;
required int32 itemsOnPage = 4;
optional string nextPage = 5;
optional string previousPage = 6;
}
message StopSchedule {
required Route route = 1;
required PtDisplayInfo pt_display_informations = 2;
required StopPoint stop_point = 3;
repeated ScheduleStopTime date_times = 4;
optional ResponseStatus response_status = 5;
optional ScheduleStopTime first_datetime = 6;
optional ScheduleStopTime last_datetime = 7;
}
message Error{
enum error_id{
bad_filter = 1;
unknown_api = 2;
date_out_of_bounds = 3;
unable_to_parse = 4;
bad_format = 5;
no_origin = 6;
no_destination = 7;
no_origin_nor_destination = 8;
no_solution = 9;
unknown_object = 10;
service_unavailable = 11;
invalid_protobuf_request = 12;
internal_error = 13;
deadline_expired = 14;
}
optional error_id id = 1;
optional string message = 2;
}
message TrafficReports{
optional Network network = 1;
repeated Line lines = 2;
repeated StopArea stop_areas = 3;
repeated VehicleJourney vehicle_journeys = 4;
}
message LineReport {
optional Line line = 1;
repeated PtObject pt_objects = 2;
}
message LinkArgs {
// it's uggly but since some link are computed with the protobuf, we need some dict-like
// structure to compute the real link url later (it depends on the API version)
optional string key = 1;
repeated string values = 2;
}
message Link {
optional string rel = 1;
optional string type = 2;
optional bool is_templated = 3;
optional string description = 4;
repeated LinkArgs kwargs = 5;
optional string ressource_name = 6; // name of the linked ressource. Used to create the full url link.
}
message GraphicalIsochrone {
optional string geojson = 1;
optional int32 max_duration = 2;
optional int32 min_duration = 3;
optional PtObject origin = 4;
optional PtObject destination = 5;
optional uint64 requested_date_time = 6;
optional uint64 min_date_time = 7;
optional uint64 max_date_time = 8;
}
message HeatMap {
optional string heat_matrix = 1;
optional PtObject origin = 2;
optional PtObject destination = 3;
optional uint64 requested_date_time = 4;
}
enum RoutingStatus {
reached = 0;
unreached = 1;
unknown = 2;
}
message RoutingElement {
required int32 duration = 1;
required RoutingStatus routing_status = 2;
}
message StreetNetworkRoutingRow {
repeated RoutingElement routing_response = 2;
}
message StreetNetworkRoutingMatrix {
repeated StreetNetworkRoutingRow rows = 1;
}
message Response {
optional int32 status_code = 1;
optional Error error = 2;
optional string info = 3;
optional Status status = 4;
optional int32 publication_date = 5;
//PtObjects
repeated string ignored_words = 11;
repeated string bad_words = 12;
repeated PtObject places = 13;
repeated PtObject places_nearby = 14;
//Ptref
repeated ValidityPattern validity_patterns = 15;
repeated Line lines = 16;
repeated JourneyPattern journey_patterns = 17;
repeated VehicleJourney vehicle_journeys = 18;
repeated StopPoint stop_points = 19;
repeated StopArea stop_areas = 20;
repeated Network networks = 21;
repeated PhysicalMode physical_modes = 22;
repeated CommercialMode commercial_modes = 23;
repeated Connection connections = 24;
repeated JourneyPatternPoint journey_pattern_points = 25;
repeated Company companies = 26;
repeated Route routes = 27;
repeated Poi pois = 28;
repeated PoiType poi_types = 29;
repeated Calendar calendars = 55;
repeated LineGroup line_groups = 56;
repeated Trip trips = 62;
repeated Contributor contributors = 64;
repeated Dataset datasets = 65;
repeated RoutePoint route_points = 66;
// For api /disruptions
repeated Impact impacts = 57;
//Journeys
repeated Journey journeys = 30;
optional ResponseType response_type = 31;
optional string prev = 32;
optional string next = 33;
optional uint32 next_request_date_time = 34; // Date time for creating the next kraken call
//TimeTables
repeated RouteSchedule route_schedules = 35;
repeated DepartureBoard departure_boards = 36;
repeated Passage next_departures = 37;
repeated Passage next_arrivals = 38;
repeated StopSchedule stop_schedules = 39;
optional Load load = 46;
optional Metadatas metadatas = 48;
optional Pagination pagination = 49;
//TrafficReports
repeated TrafficReports traffic_reports = 61;
repeated LineReport line_reports = 73;
//Fare
repeated PtJourneyFare pt_journey_fares = 80;
repeated Ticket tickets = 51;
//Ptobject
repeated PtObject pt_objects = 52;
repeated FeedPublisher feed_publishers = 53;
//experimental
repeated NearestStopPoint nearest_stop_points = 63;
// links
// some links computation is done in jormungandr but before json creation, so it is in the protobuf
// even if it is not used in kraken
repeated Link links = 67;
//Isochrone
repeated GraphicalIsochrone graphical_isochrones = 68;
//Heat map
repeated HeatMap heat_maps = 71;
optional GeoStatus geo_status = 69;
// Car CO2 emission
optional Co2Emission car_co2_emission = 70;
optional StreetNetworkRoutingMatrix sn_routing_matrix = 72;
// EquipmentReports
repeated EquipmentReport equipment_reports = 74;
repeated StopSchedule terminus_schedules = 75;
repeated VehiclePosition vehicle_positions = 76;
repeated AccessPoint access_points = 77;
// Terminus for all vehicle_journeys in journeys api
repeated StopArea terminus = 78;
optional AirPollutants air_pollutants = 79;
}
message NearestStopPoint{
optional StopPoint stop_point = 1;
optional int32 access_duration = 2;
}
message EquipmentReport {
optional Line line = 1;
repeated StopAreaEquipment stop_area_equipments = 2;
}
message VehiclePosition {
optional Line line = 1;
repeated VehicleJourneyPosition vehicle_journey_positions = 2;
}