Skip to content

Commit a3211f3

Browse files
Google APIscopybara-github
authored andcommitted
feat: add API for experimental flyover and narrow road polyline details
PiperOrigin-RevId: 703138506
1 parent 2cb4e7a commit a3211f3

4 files changed

Lines changed: 120 additions & 2 deletions

File tree

google/maps/routing/v2/BUILD.bazel

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# buildifier: disable=load-on-top
13+
1214
# This is an API workspace, having public visibility by default makes perfect sense.
1315
package(default_visibility = ["//visibility:public"])
1416

1517
##############################################################################
1618
# Common
1719
##############################################################################
18-
load("@rules_proto//proto:defs.bzl", "proto_library")
20+
# buildifier: disable=same-origin-load
1921
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
22+
load("@rules_proto//proto:defs.bzl", "proto_library")
2023

2124
proto_library(
2225
name = "routing_proto",
@@ -28,6 +31,7 @@ proto_library(
2831
"maneuver.proto",
2932
"navigation_instruction.proto",
3033
"polyline.proto",
34+
"polyline_details.proto",
3135
"route.proto",
3236
"route_label.proto",
3337
"route_modifiers.proto",
@@ -72,6 +76,7 @@ proto_library_with_info(
7276
##############################################################################
7377
# Java
7478
##############################################################################
79+
# buildifier: disable=same-origin-load
7580
load(
7681
"@com_google_googleapis_imports//:imports.bzl",
7782
"java_gapic_assembly_gradle_pkg",
@@ -134,6 +139,7 @@ java_gapic_assembly_gradle_pkg(
134139
##############################################################################
135140
# Go
136141
##############################################################################
142+
# buildifier: disable=same-origin-load
137143
load(
138144
"@com_google_googleapis_imports//:imports.bzl",
139145
"go_gapic_assembly_pkg",
@@ -187,6 +193,7 @@ go_gapic_assembly_pkg(
187193
##############################################################################
188194
# Python
189195
##############################################################################
196+
# buildifier: disable=same-origin-load
190197
load(
191198
"@com_google_googleapis_imports//:imports.bzl",
192199
"py_gapic_assembly_pkg",
@@ -238,6 +245,7 @@ py_gapic_assembly_pkg(
238245
##############################################################################
239246
# PHP
240247
##############################################################################
248+
# buildifier: disable=same-origin-load
241249
load(
242250
"@com_google_googleapis_imports//:imports.bzl",
243251
"php_gapic_assembly_pkg",
@@ -254,10 +262,13 @@ php_gapic_library(
254262
name = "routing_php_gapic",
255263
srcs = [":routing_proto_with_info"],
256264
grpc_service_config = "library_grpc_service_config.json",
265+
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
257266
rest_numeric_enums = True,
258267
service_yaml = "routes_v2.yaml",
259268
transport = "grpc+rest",
260-
deps = [":routing_php_proto"],
269+
deps = [
270+
":routing_php_proto",
271+
],
261272
)
262273

263274
# Open Source Packages
@@ -272,6 +283,7 @@ php_gapic_assembly_pkg(
272283
##############################################################################
273284
# Node.js
274285
##############################################################################
286+
# buildifier: disable=same-origin-load
275287
load(
276288
"@com_google_googleapis_imports//:imports.bzl",
277289
"nodejs_gapic_assembly_pkg",
@@ -303,6 +315,7 @@ nodejs_gapic_assembly_pkg(
303315
##############################################################################
304316
# Ruby
305317
##############################################################################
318+
# buildifier: disable=same-origin-load
306319
load(
307320
"@com_google_googleapis_imports//:imports.bzl",
308321
"ruby_cloud_gapic_library",
@@ -356,6 +369,7 @@ ruby_gapic_assembly_pkg(
356369
##############################################################################
357370
# C#
358371
##############################################################################
372+
# buildifier: disable=same-origin-load
359373
load(
360374
"@com_google_googleapis_imports//:imports.bzl",
361375
"csharp_gapic_assembly_pkg",
@@ -366,6 +380,7 @@ load(
366380

367381
csharp_proto_library(
368382
name = "routing_csharp_proto",
383+
extra_opts = [],
369384
deps = [":routing_proto"],
370385
)
371386

@@ -402,6 +417,7 @@ csharp_gapic_assembly_pkg(
402417
##############################################################################
403418
# C++
404419
##############################################################################
420+
# buildifier: disable=same-origin-load
405421
load(
406422
"@com_google_googleapis_imports//:imports.bzl",
407423
"cc_grpc_library",
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Copyright 2024 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+
15+
syntax = "proto3";
16+
17+
package google.maps.routing.v2;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Maps.Routing.V2";
22+
option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "PolylineDetailsProto";
25+
option java_package = "com.google.maps.routing.v2";
26+
option objc_class_prefix = "GMRV2";
27+
option php_namespace = "Google\\Maps\\Routing\\V2";
28+
option ruby_package = "Google::Maps::Routing::V2";
29+
30+
// Details corresponding to a given index or contiguous segment of a polyline.
31+
// Given a polyline with points P_0, P_1, ... , P_N (zero-based index), the
32+
// `PolylineDetails` defines an interval and associated metadata.
33+
message PolylineDetails {
34+
// Encapsulates the start and end indexes for a polyline detail.
35+
// For instances where the data corresponds to a single point, `start_index`
36+
// and `end_index` will be equal.
37+
message PolylinePointIndex {
38+
// The start index of this detail in the polyline.
39+
optional int32 start_index = 1;
40+
41+
// The end index of this detail in the polyline.
42+
optional int32 end_index = 2;
43+
}
44+
45+
// Encapsulates the states of road features along a stretch of polyline.
46+
enum RoadFeatureState {
47+
// The road feature's state was not computed (default value).
48+
ROAD_FEATURE_STATE_UNSPECIFIED = 0;
49+
50+
// The road feature exists.
51+
EXISTS = 1;
52+
53+
// The road feature does not exist.
54+
DOES_NOT_EXIST = 2;
55+
}
56+
57+
// Encapsulates information about flyovers along the polyline.
58+
message FlyoverInfo {
59+
// Output only. Denotes whether a flyover exists for a given stretch of the
60+
// polyline.
61+
RoadFeatureState flyover_presence = 1
62+
[(google.api.field_behavior) = OUTPUT_ONLY];
63+
64+
// The location of flyover related information along the polyline.
65+
PolylinePointIndex polyline_point_index = 2;
66+
}
67+
68+
// Encapsulates information about narrow roads along the polyline.
69+
message NarrowRoadInfo {
70+
// Output only. Denotes whether a narrow road exists for a given stretch of
71+
// the polyline.
72+
RoadFeatureState narrow_road_presence = 1
73+
[(google.api.field_behavior) = OUTPUT_ONLY];
74+
75+
// The location of narrow road related information along the polyline.
76+
PolylinePointIndex polyline_point_index = 2;
77+
}
78+
79+
// Flyover details along the polyline.
80+
repeated FlyoverInfo flyover_info = 12;
81+
82+
// Narrow road details along the polyline.
83+
repeated NarrowRoadInfo narrow_road_info = 13;
84+
}

google/maps/routing/v2/route.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/maps/routing/v2/localized_time.proto";
2121
import "google/maps/routing/v2/location.proto";
2222
import "google/maps/routing/v2/navigation_instruction.proto";
2323
import "google/maps/routing/v2/polyline.proto";
24+
import "google/maps/routing/v2/polyline_details.proto";
2425
import "google/maps/routing/v2/route_label.proto";
2526
import "google/maps/routing/v2/route_travel_mode.proto";
2627
import "google/maps/routing/v2/speed_reading_interval.proto";
@@ -131,6 +132,9 @@ message Route {
131132
// `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests
132133
// that have Via waypoints.
133134
string route_token = 12;
135+
136+
// Contains information about details along the polyline.
137+
PolylineDetails polyline_details = 14;
134138
}
135139

136140
// Contains the additional information that the user should be informed

google/maps/routing/v2/routes_service.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ message ComputeRoutesRequest {
180180
// is meant to be read as-is. This content is for display only.
181181
// Do not programmatically parse it.
182182
HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 4;
183+
184+
// Flyover information for the route(s). The
185+
// `routes.polyline_details.flyover_info` fieldmask must be specified to
186+
// return this information. This data will only currently be populated for
187+
// certain metros in India. This feature is experimental, and the
188+
// SKU/charge is subject to change.
189+
FLYOVER_INFO_ON_POLYLINE = 7;
190+
191+
// Narrow road information for the route(s). The
192+
// `routes.polyline_details.narrow_road_info` fieldmask must be specified
193+
// to return this information. This data will only currently be populated
194+
// for certain metros in India. This feature is experimental, and the
195+
// SKU/charge is subject to change.
196+
NARROW_ROAD_INFO_ON_POLYLINE = 8;
183197
}
184198

185199
// Required. Origin waypoint.

0 commit comments

Comments
 (0)