Class: Strava::Models::Waypoint

Inherits:
Response show all
Defined in:
lib/strava/models/waypoint.rb

Overview

Represents a waypoint on a route.

Waypoints are markers along a route that can indicate points of interest, turns, or other significant locations. They include GPS coordinates and descriptive information.

Examples:

Accessing route waypoints

route = client.route(1234567)
route.waypoints.each do |waypoint|
  puts "#{waypoint.title}: #{waypoint.description}"
  puts "  Location: #{waypoint.latlng.lat}, #{waypoint.latlng.lng}"
  puts "  Distance into route: #{waypoint.distance_into_route}m"
  puts "  Categories: #{waypoint.categories.join(', ')}"
end

See Also:

Instance Method Summary collapse

Instance Method Details

#categoriesArray<String>

Returns Categories or types for this waypoint (e.g., ["water", "rest"]).

Returns:

  • (Array<String>)

    Categories or types for this waypoint (e.g., ["water", "rest"])



33
# File 'lib/strava/models/waypoint.rb', line 33

property 'categories'

#descriptionString?

Returns Detailed description of the waypoint.

Returns:

  • (String, nil)

    Detailed description of the waypoint



39
# File 'lib/strava/models/waypoint.rb', line 39

property 'description'

#distance_into_routeFloat

Returns Distance from the start of the route to this waypoint in meters.

Returns:

  • (Float)

    Distance from the start of the route to this waypoint in meters



42
# File 'lib/strava/models/waypoint.rb', line 42

property 'distance_into_route'

#latlngLatLng

Returns GPS coordinates of the waypoint.

Returns:

  • (LatLng)

    GPS coordinates of the waypoint



27
# File 'lib/strava/models/waypoint.rb', line 27

property 'latlng', transform_with: ->(v) { Strava::Models::LatLng.new(v) }

#target_latlngLatLng?

Returns Target GPS coordinates (may differ from latlng for snapped waypoints).

Returns:

  • (LatLng, nil)

    Target GPS coordinates (may differ from latlng for snapped waypoints)



30
# File 'lib/strava/models/waypoint.rb', line 30

property 'target_latlng', transform_with: ->(v) { Strava::Models::LatLng.new(v) }

#titleString

Returns Title or name of the waypoint.

Returns:

  • (String)

    Title or name of the waypoint



36
# File 'lib/strava/models/waypoint.rb', line 36

property 'title'