route.proto 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.maps.routing.v2;
  16. import "google/geo/type/viewport.proto";
  17. import "google/maps/routing/v2/location.proto";
  18. import "google/maps/routing/v2/navigation_instruction.proto";
  19. import "google/maps/routing/v2/polyline.proto";
  20. import "google/maps/routing/v2/route_label.proto";
  21. import "google/maps/routing/v2/speed_reading_interval.proto";
  22. import "google/maps/routing/v2/toll_info.proto";
  23. import "google/protobuf/duration.proto";
  24. option cc_enable_arenas = true;
  25. option csharp_namespace = "Google.Maps.Routing.V2";
  26. option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
  27. option java_multiple_files = true;
  28. option java_outer_classname = "RouteProto";
  29. option java_package = "com.google.maps.routing.v2";
  30. option objc_class_prefix = "GMRV2";
  31. option php_namespace = "Google\\Maps\\Routing\\V2";
  32. option ruby_package = "Google::Maps::Routing::V2";
  33. // Encapsulates a route, which consists of a series of connected road segments
  34. // that join beginning, ending, and intermediate waypoints.
  35. message Route {
  36. // Labels for the `Route` that are useful to identify specific properties
  37. // of the route to compare against others.
  38. repeated RouteLabel route_labels = 13;
  39. // A collection of legs (path segments between waypoints) that make-up the
  40. // route. Each leg corresponds to the trip between two non-`via` Waypoints.
  41. // For example, a route with no intermediate waypoints has only one leg. A
  42. // route that includes one non-`via` intermediate waypoint has two legs. A
  43. // route that includes one `via` intermediate waypoint has one leg. The order
  44. // of the legs matches the order of Waypoints from `origin` to `intermediates`
  45. // to `destination`.
  46. repeated RouteLeg legs = 1;
  47. // The travel distance of the route, in meters.
  48. int32 distance_meters = 2;
  49. // The length of time needed to navigate the route. If you set the
  50. // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as
  51. // `static_duration`. If you set the `routing_preference` to either
  52. // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated
  53. // taking traffic conditions into account.
  54. google.protobuf.Duration duration = 3;
  55. // The duration of traveling through the route without taking traffic
  56. // conditions into consideration.
  57. google.protobuf.Duration static_duration = 4;
  58. // The overall route polyline. This polyline will be the combined polyline of
  59. // all `legs`.
  60. Polyline polyline = 5;
  61. // A description of the route.
  62. string description = 6;
  63. // An array of warnings to show when displaying the route.
  64. repeated string warnings = 7;
  65. // The viewport bounding box of the polyline.
  66. google.geo.type.Viewport viewport = 8;
  67. // Additional information about the route.
  68. RouteTravelAdvisory travel_advisory = 9;
  69. // Web-safe base64 encoded route token that can be passed to NavigationSDK,
  70. // which allows the Navigation SDK to reconstruct the route during navigation,
  71. // and in the event of rerouting honor the original intention when Routes
  72. // ComputeRoutes is called. Customers should treat this token as an
  73. // opaque blob.
  74. string route_token = 12;
  75. }
  76. // Encapsulates the additional information that the user should be informed
  77. // about, such as possible traffic zone restriction etc.
  78. message RouteTravelAdvisory {
  79. // Encapsulates information about tolls on the Route.
  80. // This field is only populated if we expect there are tolls on the Route.
  81. // If this field is set but the estimated_price subfield is not populated,
  82. // we expect that road contains tolls but we do not know an estimated price.
  83. // If this field is not set, then we expect there is no toll on the Route.
  84. TollInfo toll_info = 2;
  85. // Speed reading intervals detailing traffic density. Applicable in case of
  86. // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
  87. // The intervals cover the entire polyline of the route without overlap.
  88. // The start point of a specified interval is the same as the end point of the
  89. // preceding interval.
  90. //
  91. // Example:
  92. //
  93. // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
  94. // speed_reading_intervals: [A,C), [C,D), [D,G).
  95. repeated SpeedReadingInterval speed_reading_intervals = 3;
  96. // The fuel consumption prediction in microliters.
  97. int64 fuel_consumption_microliters = 5;
  98. }
  99. // Encapsulates the additional information that the user should be informed
  100. // about, such as possible traffic zone restriction etc. on a route leg.
  101. message RouteLegTravelAdvisory {
  102. // Encapsulates information about tolls on the specific RouteLeg.
  103. // This field is only populated if we expect there are tolls on the RouteLeg.
  104. // If this field is set but the estimated_price subfield is not populated,
  105. // we expect that road contains tolls but we do not know an estimated price.
  106. // If this field does not exist, then there is no toll on the RouteLeg.
  107. TollInfo toll_info = 1;
  108. // Speed reading intervals detailing traffic density. Applicable in case of
  109. // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
  110. // The intervals cover the entire polyline of the RouteLg without overlap.
  111. // The start point of a specified interval is the same as the end point of the
  112. // preceding interval.
  113. //
  114. // Example:
  115. //
  116. // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
  117. // speed_reading_intervals: [A,C), [C,D), [D,G).
  118. repeated SpeedReadingInterval speed_reading_intervals = 2;
  119. }
  120. // Encapsulates the additional information that the user should be informed
  121. // about, such as possible traffic zone restriction on a leg step.
  122. message RouteLegStepTravelAdvisory {
  123. // Speed reading intervals detailing traffic density. Applicable in case of
  124. // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
  125. // The intervals cover the entire polyline of the RouteLegStep without
  126. // overlap. The start point of a specified interval is the same as the end
  127. // point of the preceding interval.
  128. //
  129. // Example:
  130. //
  131. // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
  132. // speed_reading_intervals: [A,C), [C,D), [D,G).
  133. repeated SpeedReadingInterval speed_reading_intervals = 1;
  134. }
  135. // Encapsulates a segment between non-`via` waypoints.
  136. message RouteLeg {
  137. // The travel distance of the route leg, in meters.
  138. int32 distance_meters = 1;
  139. // The length of time needed to navigate the leg. If the `route_preference`
  140. // is set to `TRAFFIC_UNAWARE`, then this value is the same as
  141. // `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or
  142. // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic
  143. // conditions into account.
  144. google.protobuf.Duration duration = 2;
  145. // The duration of traveling through the leg, calculated without taking
  146. // traffic conditions into consideration.
  147. google.protobuf.Duration static_duration = 3;
  148. // The overall polyline for this leg. This includes that each `step`'s
  149. // polyline.
  150. Polyline polyline = 4;
  151. // The start location of this leg. This might be different from the provided
  152. // `origin`. For example, when the provided `origin` is not near a road, this
  153. // is a point on the road.
  154. Location start_location = 5;
  155. // The end location of this leg. This might be different from the provided
  156. // `destination`. For example, when the provided `destination` is not near a
  157. // road, this is a point on the road.
  158. Location end_location = 6;
  159. // An array of steps denoting segments within this leg. Each step represents
  160. // one navigation instruction.
  161. repeated RouteLegStep steps = 7;
  162. // Encapsulates the additional information that the user should be informed
  163. // about, such as possible traffic zone restriction etc. on a route leg.
  164. RouteLegTravelAdvisory travel_advisory = 8;
  165. }
  166. // Encapsulates a segment of a `RouteLeg`. A step corresponds to a single
  167. // navigation instruction. Route legs are made up of steps.
  168. message RouteLegStep {
  169. // The travel distance of this step, in meters. In some circumstances, this
  170. // field might not have a value.
  171. int32 distance_meters = 1;
  172. // The duration of travel through this step without taking traffic conditions
  173. // into consideration. In some circumstances, this field might not have a
  174. // value.
  175. google.protobuf.Duration static_duration = 2;
  176. // The polyline associated with this step.
  177. Polyline polyline = 3;
  178. // The start location of this step.
  179. Location start_location = 4;
  180. // The end location of this step.
  181. Location end_location = 5;
  182. // Navigation instructions.
  183. NavigationInstruction navigation_instruction = 6;
  184. // Encapsulates the additional information that the user should be informed
  185. // about, such as possible traffic zone restriction on a leg step.
  186. RouteLegStepTravelAdvisory travel_advisory = 7;
  187. }