From 9505d0ac32ad10a338f671870b052a84993717f2 Mon Sep 17 00:00:00 2001 From: Google APIs Date: Mon, 30 Nov 2020 10:50:23 -0800 Subject: [PATCH] feat: added ComputeRouteMatrix to v1 endpoint. docs: updated ComputeRouteMatrix comments to reflect size restrictions. docs: clarified RouteMatrixElementCondition documentation. feat: added geo_json_linestring polyline type. feat: added Argentina toll pass. PiperOrigin-RevId: 344844888 --- google/maps/routes/v1/BUILD.bazel | 8 ++++ .../v1/compute_route_matrix_request.proto | 9 ++++ google/maps/routes/v1/polyline.proto | 6 +++ .../maps/routes/v1/route_matrix_element.proto | 4 +- google/maps/routes/v1/route_service.proto | 44 +++++++++++++++++++ google/maps/routes/v1/toll_passes.proto | 3 ++ .../maps/routes/v1alpha/route_service.proto | 11 ++--- 7 files changed, 78 insertions(+), 7 deletions(-) diff --git a/google/maps/routes/v1/BUILD.bazel b/google/maps/routes/v1/BUILD.bazel index e2fc7c32..adb08dc1 100644 --- a/google/maps/routes/v1/BUILD.bazel +++ b/google/maps/routes/v1/BUILD.bazel @@ -34,6 +34,7 @@ proto_library( "//google/type:latlng_proto", "//google/type:money_proto", "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:struct_proto", "@com_google_protobuf//:timestamp_proto", "@com_google_protobuf//:wrappers_proto", ], @@ -122,6 +123,7 @@ moved_proto_library( "//google/type:latlng_proto", "//google/type:money_proto", "@com_google_protobuf//:duration_proto", + "@com_google_protobuf//:struct_proto", "@com_google_protobuf//:timestamp_proto", "@com_google_protobuf//:wrappers_proto", ], @@ -162,6 +164,12 @@ php_grpc_library( ############################################################################## # Node.js ############################################################################## +load( + "@com_google_googleapis_imports//:imports.bzl", + "nodejs_gapic_assembly_pkg", + "nodejs_gapic_library", +) + ############################################################################## # Ruby diff --git a/google/maps/routes/v1/compute_route_matrix_request.proto b/google/maps/routes/v1/compute_route_matrix_request.proto index e9a60fe8..ee7b4eab 100644 --- a/google/maps/routes/v1/compute_route_matrix_request.proto +++ b/google/maps/routes/v1/compute_route_matrix_request.proto @@ -33,6 +33,15 @@ option php_namespace = "Google\\Maps\\Routes\\V1"; // ComputeRouteMatrix request message message ComputeRouteMatrixRequest { // Required. Array of origins, which determines the rows of the response matrix. + // Several size restrictions apply to the cardinality of origins and + // destinations: + // + // * The number of elements (origins × destinations) must be no greater than + // 625 in any case. + // * The number of elements (origins × destinations) must be no greater than + // 100 if routing_preference is set to `TRAFFIC_AWARE_OPTIMAL`. + // * The number of waypoints (origins + destinations) specified as `place_id` + // must be no greater than 50. repeated RouteMatrixOrigin origins = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Array of destinations, which determines the columns of the response matrix. diff --git a/google/maps/routes/v1/polyline.proto b/google/maps/routes/v1/polyline.proto index 53806b4b..c0bc1790 100644 --- a/google/maps/routes/v1/polyline.proto +++ b/google/maps/routes/v1/polyline.proto @@ -16,6 +16,8 @@ syntax = "proto3"; package google.maps.routes.v1; +import "google/protobuf/struct.proto"; + option cc_enable_arenas = true; option csharp_namespace = "Google.Maps.Routes.V1"; option go_package = "google.golang.org/genproto/googleapis/maps/routes/v1;routes"; @@ -32,6 +34,10 @@ message Polyline { // The string encoding of the polyline using the [polyline encoding // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) string encoded_polyline = 1; + + // Specifies a polyline using the [GeoJSON LineString + // format](https://tools.ietf.org/html/rfc7946#section-3.1.4) + google.protobuf.Struct geo_json_linestring = 2; } } diff --git a/google/maps/routes/v1/route_matrix_element.proto b/google/maps/routes/v1/route_matrix_element.proto index 2e05c113..e729af2a 100644 --- a/google/maps/routes/v1/route_matrix_element.proto +++ b/google/maps/routes/v1/route_matrix_element.proto @@ -73,7 +73,7 @@ message RouteMatrixElement { // The condition of the route being returned. enum RouteMatrixElementCondition { - // Not used. + // Only used when the `status` of the element is not OK. ROUTE_MATRIX_ELEMENT_CONDITION_UNSPECIFIED = 0; // A route was found, and the corresponding information was filled out for the @@ -81,6 +81,6 @@ enum RouteMatrixElementCondition { ROUTE_EXISTS = 1; // No route could be found. Fields containing route information, such as - // distance_meters or duration, will not be filled out in the element. + // `distance_meters` or `duration`, will not be filled out in the element. ROUTE_NOT_FOUND = 2; } diff --git a/google/maps/routes/v1/route_service.proto b/google/maps/routes/v1/route_service.proto index 602ba928..c3512820 100644 --- a/google/maps/routes/v1/route_service.proto +++ b/google/maps/routes/v1/route_service.proto @@ -17,8 +17,10 @@ syntax = "proto3"; package google.maps.routes.v1; import "google/api/annotations.proto"; +import "google/maps/routes/v1/compute_route_matrix_request.proto"; import "google/maps/routes/v1/compute_routes_request.proto"; import "google/maps/routes/v1/compute_routes_response.proto"; +import "google/maps/routes/v1/route_matrix_element.proto"; import "google/api/client.proto"; option cc_enable_arenas = true; @@ -75,4 +77,46 @@ service RoutesPreferred { body: "*" }; } + + // Takes in a list of origins and destinations and returns a stream containing + // route information for each combination of origin and destination. + // + // **NOTE:** This method requires that you specify a response field mask in + // the input. You can provide the response field mask by using the URL + // parameter `$fields` or `fields`, or by using the HTTP/gRPC header + // `X-Goog-FieldMask` (see the [available URL parameters and + // headers](https://cloud.google.com/apis/docs/system-parameters). The value + // is a comma separated list of field paths. See this detailed documentation + // about [how to construct the field + // paths](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto). + // + // For example, in this method: + // + // * Field mask of all available fields (for manual inspection): + // `X-Goog-FieldMask: *` + // * Field mask of route durations, distances, element status, condition, and + // element indices (an example production setup): + // `X-Goog-FieldMask: + // originIndex,destinationIndex,status,condition,distanceMeters,duration` + // + // It is critical that you include `status` in your field mask as otherwise + // all messages will appear to be OK. Google discourages the use of the + // wildcard (`*`) response field mask, because: + // + // * Selecting only the fields that you need helps our server save computation + // cycles, allowing us to return the result to you with a lower latency. + // * Selecting only the fields that you need in your production job ensures + // stable latency performance. We might add more response fields in the + // future, and those new fields might require extra computation time. If you + // select all fields, or if you select all fields at the top level, then you + // might experience performance degradation because any new field we add will + // be automatically included in the response. + // * Selecting only the fields that you need results in a smaller response + // size, and thus higher network throughput. + rpc ComputeRouteMatrix(ComputeRouteMatrixRequest) returns (stream RouteMatrixElement) { + option (google.api.http) = { + post: "/v1:computeRouteMatrix" + body: "*" + }; + } } diff --git a/google/maps/routes/v1/toll_passes.proto b/google/maps/routes/v1/toll_passes.proto index f823e9d6..693141ec 100644 --- a/google/maps/routes/v1/toll_passes.proto +++ b/google/maps/routes/v1/toll_passes.proto @@ -36,4 +36,7 @@ enum TollPass { // Australia-wide toll pass. // See additional details at https://www.linkt.com.au/. AU_LINKT = 2; + + // Argentina toll pass. See additional details at https://telepase.com.ar + AR_TELEPASE = 3; } diff --git a/google/maps/routes/v1alpha/route_service.proto b/google/maps/routes/v1alpha/route_service.proto index 7babfb4a..ec756bb1 100644 --- a/google/maps/routes/v1alpha/route_service.proto +++ b/google/maps/routes/v1alpha/route_service.proto @@ -93,13 +93,14 @@ service RoutesAlpha { // // * Field mask of all available fields (for manual inspection): // `X-Goog-FieldMask: *` - // * Field mask of route durations, distances, element status, and element - // indices (an example production setup): + // * Field mask of route durations, distances, element status, condition, and + // element indices (an example production setup): // `X-Goog-FieldMask: - // originIndex,destinationIndex,status,distanceMeters,duration` + // originIndex,destinationIndex,status,condition,distanceMeters,duration` // - // Google discourages the use of the wildcard (`*`) response field mask, - // because: + // It is critical that you include `status` in your field mask as otherwise + // all messages will appear to be OK. Google discourages the use of the + // wildcard (`*`) response field mask, because: // // * Selecting only the fields that you need helps our server save computation // cycles, allowing us to return the result to you with a lower latency.