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
This commit is contained in:
Google APIs 2020-11-30 10:50:23 -08:00 committed by Copybara-Service
parent f5544ea85e
commit 9505d0ac32
7 changed files with 78 additions and 7 deletions

View File

@ -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

View File

@ -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.

View File

@ -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;
}
}

View File

@ -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;
}

View File

@ -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: "*"
};
}
}

View File

@ -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;
}

View File

@ -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.