// Copyright 2026 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/api/field_behavior.proto"; option csharp_namespace = "Google.Maps.Routing.V2"; option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; option java_multiple_files = true; option java_outer_classname = "PolylineDetailsProto"; 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"; // Details corresponding to a given index or contiguous segment of a polyline. // Given a polyline with points P_0, P_1, ... , P_N (zero-based index), the // `PolylineDetails` defines an interval and associated metadata. message PolylineDetails { // Encapsulates the start and end indexes for a polyline detail. // For instances where the data corresponds to a single point, `start_index` // and `end_index` will be equal. message PolylinePointIndex { // The start index of this detail in the polyline. optional int32 start_index = 1; // The end index of this detail in the polyline. optional int32 end_index = 2; } // Encapsulates the states of road features along a stretch of polyline. enum RoadFeatureState { // The road feature's state was not computed (default value). ROAD_FEATURE_STATE_UNSPECIFIED = 0; // The road feature exists. EXISTS = 1; // The road feature does not exist. DOES_NOT_EXIST = 2; } // Encapsulates information about tunnels along the polyline. message TunnelInfo { // Denotes whether a tunnel exists for a given stretch of the polyline. RoadFeatureState tunnel_presence = 1; // The location of tunnel related information along the polyline. PolylinePointIndex polyline_point_index = 2; } // Encapsulates information about bridges along the polyline. message BridgeInfo { // Denotes whether a bridge exists for a given stretch of the polyline. RoadFeatureState bridge_presence = 1; // The location of bridge related information along the polyline. PolylinePointIndex polyline_point_index = 2; } // Encapsulates information about skyways along the polyline. message SkywayInfo { // Denotes whether a skyway exists for a given stretch of the polyline. RoadFeatureState skyway_presence = 1; // The location of skyway related information along the polyline. PolylinePointIndex polyline_point_index = 2; } // Encapsulates information about flyovers along the polyline. message FlyoverInfo { // Output only. Denotes whether a flyover exists for a given stretch of the // polyline. RoadFeatureState flyover_presence = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The location of flyover related information along the polyline. PolylinePointIndex polyline_point_index = 2; } // Encapsulates information about narrow roads along the polyline. message NarrowRoadInfo { // Output only. Denotes whether a narrow road exists for a given stretch of // the polyline. RoadFeatureState narrow_road_presence = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The location of narrow road related information along the polyline. PolylinePointIndex polyline_point_index = 2; } // Tunnel details along the polyline. This field is populated if the request // specifies the `avoid_tunnels` route modifier and the resultant route fails // to avoid them, OR if `TUNNEL_INFO_ON_POLYLINE` is specified in // `extra_computations` and the route contains tunnels. repeated TunnelInfo tunnel_info = 8; // Flyover details along the polyline. repeated FlyoverInfo flyover_info = 12; // Narrow road details along the polyline. repeated NarrowRoadInfo narrow_road_info = 13; // Bridge details along the polyline. repeated BridgeInfo bridge_info = 14; // Skyway details along the polyline. repeated SkywayInfo skyway_info = 15; }