Skip to content

Commit

Permalink
feat: added support for specifying waypoints as addresses
Browse files Browse the repository at this point in the history
docs: clarified usage of RouteLegStepTravelAdvisory in comment

PiperOrigin-RevId: 515362180
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 9, 2023
1 parent 86312f6 commit bb333b2
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 10 deletions.
1 change: 1 addition & 0 deletions google/maps/routing/v2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ proto_library(
name = "routing_proto",
srcs = [
"fallback_info.proto",
"geocoding_results.proto",
"location.proto",
"maneuver.proto",
"navigation_instruction.proto",
Expand Down
71 changes: 71 additions & 0 deletions google/maps/routing/v2/geocoding_results.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.maps.routing.v2;

import "google/rpc/status.proto";

option cc_enable_arenas = true;
option csharp_namespace = "Google.Maps.Routing.V2";
option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
option java_multiple_files = true;
option java_outer_classname = "GeocodingResultsProto";
option java_package = "com.google.maps.routing.v2";
option objc_class_prefix = "GMRV2";
option php_namespace = "Google\\Maps\\Routing\\V2";
option ruby_package = "Google::Maps::Routing::V2";

// Contains GeocodedWaypoints for origin, destination and intermediate
// waypoints. Only populated for address waypoints.
message GeocodingResults {
// Origin geocoded waypoint.
GeocodedWaypoint origin = 1;

// Destination geocoded waypoint.
GeocodedWaypoint destination = 2;

// A list of intermediate geocoded waypoints each containing an index field
// that corresponds to the zero-based position of the waypoint in the order
// they were specified in the request.
repeated GeocodedWaypoint intermediates = 3;
}

// Details about the locations used as waypoints. Only populated for address
// waypoints. Includes details about the geocoding results for the purposes of
// determining what the address was geocoded to.
message GeocodedWaypoint {
// Indicates the status code resulting from the geocoding operation.
google.rpc.Status geocoder_status = 1;

// The index of the corresponding intermediate waypoint in the request.
// Only populated if the corresponding waypoint is an intermediate
// waypoint.
optional int32 intermediate_waypoint_request_index = 2;

// The type(s) of the result, in the form of zero or more type tags.
// Supported types:
// https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types
repeated string type = 3;

// Indicates that the geocoder did not return an exact match for the original
// request, though it was able to match part of the requested address. You may
// wish to examine the original request for misspellings and/or an incomplete
// address.
bool partial_match = 4;

// The place ID for this result.
string place_id = 5;
}
11 changes: 1 addition & 10 deletions google/maps/routing/v2/route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,7 @@ message RouteLegTravelAdvisory {
// Encapsulates the additional information that the user should be informed
// about, such as possible traffic zone restriction on a leg step.
message RouteLegStepTravelAdvisory {
// Speed reading intervals detailing traffic density. Applicable in case of
// `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
// The intervals cover the entire polyline of the RouteLegStep without
// overlap. The start point of a specified interval is the same as the end
// point of the preceding interval.
//
// Example:
//
// polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
// speed_reading_intervals: [A,C), [C,D), [D,G).
// NOTE: This field is not currently populated.
repeated SpeedReadingInterval speed_reading_intervals = 1;
}

Expand Down
4 changes: 4 additions & 0 deletions google/maps/routing/v2/routes_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/maps/routing/v2/fallback_info.proto";
import "google/maps/routing/v2/geocoding_results.proto";
import "google/maps/routing/v2/polyline.proto";
import "google/maps/routing/v2/route.proto";
import "google/maps/routing/v2/route_modifiers.proto";
Expand Down Expand Up @@ -246,6 +247,9 @@ message ComputeRoutesResponse {
// computation. When fallback mode is used, this field contains detailed info
// about the fallback response. Otherwise this field is unset.
FallbackInfo fallback_info = 2;

// Contains geocoding response info for waypoints specified as addresses.
GeocodingResults geocoding_results = 3;
}

// ComputeRouteMatrix request message
Expand Down
4 changes: 4 additions & 0 deletions google/maps/routing/v2/waypoint.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ message Waypoint {

// The POI Place ID associated with the waypoint.
string place_id = 2;

// Human readable address or a plus code.
// See https://plus.codes for details.
string address = 7;
}

// Marks this waypoint as a milestone rather a stopping point. For
Expand Down

0 comments on commit bb333b2

Please sign in to comment.