Reference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::ShipmentRoute::TravelStep.
Deprecated: Use
ShipmentRoute.Transition
instead. Travel between each visit along the route: from the vehicle's
start_location to the first visit's arrival_location, then from the
first visit's departure_location to the second visit's
arrival_location, and so on until the vehicle's end_location. This
accounts only for the actual travel between visits, not counting the
waiting time, the time spent performing a visit, nor the distance covered
during a visit.
(::Boolean) — When traffic is requested via
OptimizeToursRequest.consider_road_traffic,
and the traffic info couldn't be retrieved for a TravelStep, this boolean
is set to true. This may be temporary (rare hiccup in the realtime
traffic servers) or permanent (no data for this location).
#traffic_info_unavailable=
deftraffic_info_unavailable=(value)->::Boolean
Parameter
value (::Boolean) — When traffic is requested via
OptimizeToursRequest.consider_road_traffic,
and the traffic info couldn't be retrieved for a TravelStep, this boolean
is set to true. This may be temporary (rare hiccup in the realtime
traffic servers) or permanent (no data for this location).
Returns
(::Boolean) — When traffic is requested via
OptimizeToursRequest.consider_road_traffic,
and the traffic info couldn't be retrieved for a TravelStep, this boolean
is set to true. This may be temporary (rare hiccup in the realtime
traffic servers) or permanent (no data for this location).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Optimization V1 API - Class Google::Cloud::Optimization::V1::ShipmentRoute::TravelStep (v0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.11.1](/ruby/docs/reference/google-cloud-optimization-v1/0.11.1/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.10.0](/ruby/docs/reference/google-cloud-optimization-v1/0.10.0/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.9.2](/ruby/docs/reference/google-cloud-optimization-v1/0.9.2/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.8.2](/ruby/docs/reference/google-cloud-optimization-v1/0.8.2/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.7.0](/ruby/docs/reference/google-cloud-optimization-v1/0.7.0/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.6.0](/ruby/docs/reference/google-cloud-optimization-v1/0.6.0/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.5.0](/ruby/docs/reference/google-cloud-optimization-v1/0.5.0/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.4.1](/ruby/docs/reference/google-cloud-optimization-v1/0.4.1/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.3.0](/ruby/docs/reference/google-cloud-optimization-v1/0.3.0/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.2.1](/ruby/docs/reference/google-cloud-optimization-v1/0.2.1/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep)\n- [0.1.1](/ruby/docs/reference/google-cloud-optimization-v1/0.1.1/Google-Cloud-Optimization-V1-ShipmentRoute-TravelStep) \nReference documentation and code samples for the Cloud Optimization V1 API class Google::Cloud::Optimization::V1::ShipmentRoute::TravelStep.\n\nDeprecated: Use\n[ShipmentRoute.Transition](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-ShipmentRoute-Transition \"Google::Cloud::Optimization::V1::ShipmentRoute::Transition (class)\")\ninstead. Travel between each visit along the route: from the vehicle's\n`start_location` to the first visit's `arrival_location`, then from the\nfirst visit's `departure_location` to the second visit's\n`arrival_location`, and so on until the vehicle's `end_location`. This\naccounts only for the actual travel between visits, not counting the\nwaiting time, the time spent performing a visit, nor the distance covered\nduring a visit.\n\n\nInvariant: `travel_steps_size() == visits_size() + 1`.\n\n\u003cbr /\u003e\n\nIf the vehicle does not have a start_ and/or end_location, the\ncorresponding travel metrics are 0 and/or empty. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #distance_meters\n\n def distance_meters() -\u003e ::Float\n\n**Returns**\n\n- (::Float) --- Distance traveled during the step.\n\n### #distance_meters=\n\n def distance_meters=(value) -\u003e ::Float\n\n**Parameter**\n\n- **value** (::Float) --- Distance traveled during the step. \n**Returns**\n\n- (::Float) --- Distance traveled during the step.\n\n### #duration\n\n def duration() -\u003e ::Google::Protobuf::Duration\n\n**Returns**\n\n- ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- Duration of the travel step.\n\n### #duration=\n\n def duration=(value) -\u003e ::Google::Protobuf::Duration\n\n**Parameter**\n\n- **value** ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- Duration of the travel step. \n**Returns**\n\n- ([::Google::Protobuf::Duration](./Google-Protobuf-Duration)) --- Duration of the travel step.\n\n### #route_polyline\n\n def route_polyline() -\u003e ::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline\n\n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline](./Google-Cloud-Optimization-V1-ShipmentRoute-EncodedPolyline)) --- The encoded polyline representation of the route followed during the step.\n\n\n This field is only populated if\n [OptimizeToursRequest.populate_travel_step_polylines](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursRequest#Google__Cloud__Optimization__V1__OptimizeToursRequest_populate_travel_step_polylines_instance_ \"Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines (method)\")\n is set to true.\n\n### #route_polyline=\n\n def route_polyline=(value) -\u003e ::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline\n\n**Parameter**\n\n- **value** ([::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline](./Google-Cloud-Optimization-V1-ShipmentRoute-EncodedPolyline)) --- The encoded polyline representation of the route followed during the step.\n\n\n This field is only populated if\n [OptimizeToursRequest.populate_travel_step_polylines](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursRequest#Google__Cloud__Optimization__V1__OptimizeToursRequest_populate_travel_step_polylines_instance_ \"Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines (method)\")\nis set to true. \n**Returns**\n\n- ([::Google::Cloud::Optimization::V1::ShipmentRoute::EncodedPolyline](./Google-Cloud-Optimization-V1-ShipmentRoute-EncodedPolyline)) --- The encoded polyline representation of the route followed during the step.\n\n\n This field is only populated if\n [OptimizeToursRequest.populate_travel_step_polylines](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursRequest#Google__Cloud__Optimization__V1__OptimizeToursRequest_populate_travel_step_polylines_instance_ \"Google::Cloud::Optimization::V1::OptimizeToursRequest#populate_travel_step_polylines (method)\")\n is set to true.\n\n### #traffic_info_unavailable\n\n def traffic_info_unavailable() -\u003e ::Boolean\n\n**Returns**\n\n- (::Boolean) --- When traffic is requested via [OptimizeToursRequest.consider_road_traffic](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursRequest#Google__Cloud__Optimization__V1__OptimizeToursRequest_consider_road_traffic_instance_ \"Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic (method)\"), and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location).\n\n### #traffic_info_unavailable=\n\n def traffic_info_unavailable=(value) -\u003e ::Boolean\n\n**Parameter**\n\n- **value** (::Boolean) --- When traffic is requested via [OptimizeToursRequest.consider_road_traffic](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursRequest#Google__Cloud__Optimization__V1__OptimizeToursRequest_consider_road_traffic_instance_ \"Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic (method)\"), and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location). \n**Returns**\n\n- (::Boolean) --- When traffic is requested via [OptimizeToursRequest.consider_road_traffic](/ruby/docs/reference/google-cloud-optimization-v1/latest/Google-Cloud-Optimization-V1-OptimizeToursRequest#Google__Cloud__Optimization__V1__OptimizeToursRequest_consider_road_traffic_instance_ \"Google::Cloud::Optimization::V1::OptimizeToursRequest#consider_road_traffic (method)\"), and the traffic info couldn't be retrieved for a TravelStep, this boolean is set to true. This may be temporary (rare hiccup in the realtime traffic servers) or permanent (no data for this location)."]]