Skip to content

Commit

Permalink
feat: [google-maps-routing] add API for shorter distance reference ro…
Browse files Browse the repository at this point in the history
…utes (#13306)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 700387857

Source-Link:
googleapis/googleapis@4deb95d

Source-Link:
googleapis/googleapis-gen@a38a16c
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiYTM4YTE2YzQzYzY4NjgxYmJmNWMwZGU3OTE0YjcyNzkwYTRiNmIyYiJ9

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 27, 2024
1 parent b84e0a9 commit 104d44d
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.6.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.6.12" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
35 changes: 19 additions & 16 deletions packages/google-maps-routing/google/maps/routing_v2/types/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ class Route(proto.Message):
localized_values (google.maps.routing_v2.types.Route.RouteLocalizedValues):
Text representations of properties of the ``Route``.
route_token (str):
A web-safe, base64-encoded route token that can be passed to
the Navigation SDK, that allows the Navigation SDK to
reconstruct the route during navigation, and, in the event
of rerouting, honor the original intention when you created
the route by calling ComputeRoutes. Customers should treat
this token as an opaque blob. It is not meant for reading or
mutating. NOTE: ``Route.route_token`` is only available for
requests that have set
``ComputeRoutesRequest.routing_preference`` to
An opaque token that can be passed to `Navigation
SDK <https://developers.google.com/maps/documentation/navigation>`__
to reconstruct the route during navigation, and, in the
event of rerouting, honor the original intention when the
route was created. Treat this token as an opaque blob. Don't
compare its value across requests as its value may change
even if the service returns the exact same route.
NOTE: ``Route.route_token`` is only available for requests
that have set ``ComputeRoutesRequest.routing_preference`` to
``TRAFFIC_AWARE`` or ``TRAFFIC_AWARE_OPTIMAL``.
``Route.route_token`` is not supported for requests that
have Via waypoints.
Expand All @@ -131,9 +132,10 @@ class RouteLocalizedValues(proto.Message):
distance (google.type.localized_text_pb2.LocalizedText):
Travel distance represented in text form.
duration (google.type.localized_text_pb2.LocalizedText):
Duration taking traffic conditions into consideration,
represented in text form. Note: If you did not request
traffic information, this value will be the same value as
Duration, represented in text form and localized to the
region of the query. Takes traffic conditions into
consideration. Note: If you did not request traffic
information, this value is the same value as
``static_duration``.
static_duration (google.type.localized_text_pb2.LocalizedText):
Duration without taking traffic conditions
Expand Down Expand Up @@ -408,9 +410,10 @@ class RouteLegLocalizedValues(proto.Message):
distance (google.type.localized_text_pb2.LocalizedText):
Travel distance represented in text form.
duration (google.type.localized_text_pb2.LocalizedText):
Duration taking traffic conditions into consideration
represented in text form. Note: If you did not request
traffic information, this value will be the same value as
Duration, represented in text form and localized to the
region of the query. Takes traffic conditions into
consideration. Note: If you did not request traffic
information, this value is the same value as
static_duration.
static_duration (google.type.localized_text_pb2.LocalizedText):
Duration without taking traffic conditions
Expand Down Expand Up @@ -695,7 +698,7 @@ class RouteLegStepTransitDetails(proto.Message):
This count includes the arrival stop, but excludes the
departure stop. For example, if your route leaves from Stop
A, passes through stops B and C, and arrives at stop D,
stop_count will return 3.
stop_count returns 3.
trip_short_text (str):
The text that appears in schedules and sign boards to
identify a transit trip to passengers. The text should
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ class RouteLabel(proto.Enum):
Fuel efficient route. Routes labeled with
this value are determined to be optimized for
Eco parameters such as fuel consumption.
SHORTER_DISTANCE (4):
Shorter travel distance route. This is an
experimental feature.
"""
ROUTE_LABEL_UNSPECIFIED = 0
DEFAULT_ROUTE = 1
DEFAULT_ROUTE_ALTERNATE = 2
FUEL_EFFICIENT = 3
SHORTER_DISTANCE = 4


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ class ComputeRoutesRequest(proto.Message):
calculation objective than the default route. For example a
``FUEL_EFFICIENT`` reference route calculation takes into
account various parameters that would generate an optimal
fuel efficient route.
fuel efficient route. When using this feature, look for
[``route_labels``][google.maps.routing.v2.Route.route_labels]
on the resulting routes.
extra_computations (MutableSequence[google.maps.routing_v2.types.ComputeRoutesRequest.ExtraComputation]):
Optional. A list of extra computations which
may be used to complete the request. Note: These
Expand Down Expand Up @@ -199,12 +201,29 @@ class ReferenceRoute(proto.Enum):
Not used. Requests containing this value
fail.
FUEL_EFFICIENT (1):
Fuel efficient route. Routes labeled with
this value are determined to be optimized for
parameters such as fuel consumption.
Fuel efficient route.
SHORTER_DISTANCE (2):
Route with shorter travel distance. This is an experimental
feature.
For ``DRIVE`` requests, this feature prioritizes shorter
distance over driving comfort. For example, it may prefer
local roads instead of highways, take dirt roads, cut
through parking lots, etc. This feature does not return any
maneuvers that Google Maps knows to be illegal.
For ``BICYCLE`` and ``TWO_WHEELER`` requests, this feature
returns routes similar to those returned when you don't
specify ``requested_reference_routes``.
This feature is not compatible with any other travel modes,
via intermediate waypoints, or ``optimize_waypoint_order``;
such requests will fail. However, you can use it with any
``routing_preference``.
"""
REFERENCE_ROUTE_UNSPECIFIED = 0
FUEL_EFFICIENT = 1
SHORTER_DISTANCE = 2

class ExtraComputation(proto.Enum):
r"""Extra computations to perform while completing the request.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-maps-routing",
"version": "0.6.12"
"version": "0.1.0"
},
"snippets": [
{
Expand Down

0 comments on commit 104d44d

Please sign in to comment.