compute_routes_request.proto 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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.routes.v1;
  16. import "google/maps/routes/v1/polyline.proto";
  17. import "google/maps/routes/v1/toll_passes.proto";
  18. import "google/maps/routes/v1/vehicle_emission_type.proto";
  19. import "google/maps/routes/v1/waypoint.proto";
  20. import "google/protobuf/timestamp.proto";
  21. option cc_enable_arenas = true;
  22. option csharp_namespace = "Google.Maps.Routes.V1";
  23. option go_package = "google.golang.org/genproto/googleapis/maps/routes/v1;routes";
  24. option java_multiple_files = true;
  25. option java_outer_classname = "ComputeRoutesRequestProto";
  26. option java_package = "com.google.maps.routes.v1";
  27. option objc_class_prefix = "GMRS";
  28. option php_namespace = "Google\\Maps\\Routes\\V1";
  29. // ComputeRoutes request message.
  30. message ComputeRoutesRequest {
  31. // Required. Origin waypoint.
  32. Waypoint origin = 1;
  33. // Required. Destination waypoint.
  34. Waypoint destination = 2;
  35. // Optional. A set of waypoints along the route (excluding terminal points),
  36. // for either stopping at or passing by. Up to 25 intermediate waypoints are
  37. // supported.
  38. repeated Waypoint intermediates = 3;
  39. // Optional. Specifies the mode of transportation.
  40. RouteTravelMode travel_mode = 4;
  41. // Optional. Specifies how to compute the route. The server
  42. // attempts to use the selected routing preference to compute the route. If
  43. // the routing preference results in an error or an extra long latency, then
  44. // an error is returned. In the future, we might implement a fallback
  45. // mechanism to use a different option when the preferred option does not give
  46. // a valid result. You can specify this option only when the `travel_mode` is
  47. // `DRIVE` or `TWO_WHEELER`, otherwise the request fails.
  48. RoutingPreference routing_preference = 5;
  49. // Optional. Specifies your preference for the quality of the polyline.
  50. PolylineQuality polyline_quality = 6;
  51. // Optional. Specifies the preferred encoding for the polyline.
  52. PolylineEncoding polyline_encoding = 12;
  53. // Optional. The departure time. If you don't set this value, then this value
  54. // defaults to the time that you made the request. If you set this value to a
  55. // time that has already occurred, then the request fails.
  56. google.protobuf.Timestamp departure_time = 7;
  57. // Specifies whether to calculate alternate routes in addition to the route.
  58. bool compute_alternative_routes = 8;
  59. // Optional. A set of conditions to satisfy that affect the way routes are
  60. // calculated.
  61. RouteModifiers route_modifiers = 9;
  62. // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
  63. // information, see
  64. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
  65. // [Language Support](https://developers.google.com/maps/faq#languagesupport)
  66. // for the list of supported languages. When you don't provide this value, the
  67. // display language is inferred from the location of the route request.
  68. string language_code = 10;
  69. // Optional. Specifies the units of measure for the display fields. This
  70. // includes the `instruction` field in `NavigationInstruction`. The units of
  71. // measure used for the route, leg, step distance, and duration are not
  72. // affected by this value. If you don't provide this value, then the display
  73. // units are inferred from the location of the request.
  74. Units units = 11;
  75. // If optimizeWaypointOrder is set to true, an attempt is made to re-order the
  76. // specified intermediate waypoints to minimize the overall cost of the route.
  77. // If any of the intermediate waypoints is via waypoint the request fails. Use
  78. // ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index to find
  79. // the new ordering. If routes.optimized_intermediate_waypoint_index is not
  80. // requested in the `X-Goog-FieldMask` header, the request fails. If
  81. // optimizeWaypointOrder is set to false,
  82. // ComputeRoutesResponse.optimized_intermediate_waypoint_index is empty.
  83. bool optimize_waypoint_order = 13;
  84. }
  85. // Encapsulates a set of optional conditions to satisfy when calculating the
  86. // routes.
  87. message RouteModifiers {
  88. // Specifies whether to avoid toll roads where reasonable. Preference will be
  89. // given to routes not containing toll roads. Applies only to the `DRIVE` and
  90. // `TWO_WHEELER` travel modes.
  91. bool avoid_tolls = 1;
  92. // Specifies whether to avoid highways where reasonable. Preference will be
  93. // given to routes not containing highways. Applies only to the `DRIVE` and
  94. // `TWO_WHEELER` travel modes.
  95. bool avoid_highways = 2;
  96. // Specifies whether to avoid ferries where reasonable. Preference will be
  97. // given to routes not containing travel by ferries.
  98. // Applies only to the `DRIVE` and`TWO_WHEELER` travel modes.
  99. bool avoid_ferries = 3;
  100. // Specifies whether to avoid navigating indoors where reasonable. Preference
  101. // will be given to routes not containing indoor navigation.
  102. // Applies only to the `WALK` travel mode.
  103. bool avoid_indoor = 4;
  104. // Specifies the vehicle information.
  105. VehicleInfo vehicle_info = 5;
  106. // Encapsulates information about toll passes.
  107. // If toll passes are provided, the API tries to return the pass price. If
  108. // toll passes are not provided, the API treats the toll pass as unknown and
  109. // tries to return the cash price.
  110. // Applies only to the DRIVE and TWO_WHEELER travel modes.
  111. repeated TollPass toll_passes = 6;
  112. }
  113. // Encapsulates the vehicle information, such as the license plate last
  114. // character.
  115. message VehicleInfo {
  116. // Specifies the license plate last character. Could be a digit or a letter.
  117. string license_plate_last_character = 1;
  118. // Describes the vehicle's emission type.
  119. // Applies only to the DRIVE travel mode.
  120. VehicleEmissionType emission_type = 2;
  121. }
  122. // A set of values used to specify the mode of travel.
  123. enum RouteTravelMode {
  124. // No travel mode specified. Defaults to `DRIVE`.
  125. TRAVEL_MODE_UNSPECIFIED = 0;
  126. // Travel by passenger car.
  127. DRIVE = 1;
  128. // Travel by bicycle.
  129. BICYCLE = 2;
  130. // Travel by walking.
  131. WALK = 3;
  132. // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this
  133. // differs from the `BICYCLE` travel mode which covers human-powered mode.
  134. TWO_WHEELER = 4;
  135. // Travel by licensed taxi, which may allow the vehicle to travel on
  136. // designated taxi lanes in some areas.
  137. TAXI = 5;
  138. }
  139. // A set of values that specify factors to take into consideration when
  140. // calculating the route.
  141. enum RoutingPreference {
  142. // No routing preference specified. Default to `TRAFFIC_AWARE`.
  143. ROUTING_PREFERENCE_UNSPECIFIED = 0;
  144. // Computes routes without taking traffic conditions into consideration.
  145. // Suitable when traffic conditions don't matter. Using this value produces
  146. // the lowest latency.
  147. TRAFFIC_UNAWARE = 1;
  148. // Calculates routes taking traffic conditions into consideration. In contrast
  149. // to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to significantly
  150. // reduce latency.
  151. TRAFFIC_AWARE = 2;
  152. // Calculates the routes taking traffic conditions into consideration,
  153. // without applying most performance optimizations. Using this value produces
  154. // the highest latency.
  155. TRAFFIC_AWARE_OPTIMAL = 3;
  156. }
  157. // A set of values that specify the unit of measure used in the display.
  158. enum Units {
  159. // Units of measure not specified. Defaults to the unit of measure inferred
  160. // from the request.
  161. UNITS_UNSPECIFIED = 0;
  162. // Metric units of measure.
  163. METRIC = 1;
  164. // Imperial (English) units of measure.
  165. IMPERIAL = 2;
  166. }