Skip to content

Commit

Permalink
feat: add point[3] as time
Browse files Browse the repository at this point in the history
Point already accepts a time property. Waypoint and Trackpoint, currently only supply lon, lat, and elevation. This PR adds point[3] as the time param. This should hopefully enable it to work with RGeo::Cartesian.factor has_m_coordinate: true
  • Loading branch information
tyrauber committed Jul 11, 2024
1 parent a424436 commit 8b22fd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gpx/geo_json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ def point_to_waypoint(point, gpx_file)
GPX::Waypoint.new(gpx_file: gpx_file,
lon: point[0],
lat: point[1],
elevation: point[2])
elevation: point[2],
time: point[3])
end

# Given a GeoJSON coorindate point, and
Expand All @@ -167,7 +168,8 @@ def point_to_track_point(point, seg)
GPX::TrackPoint.new(segment: seg,
lon: point[0],
lat: point[1],
elevation: point[2])
elevation: point[2],
time: point[3])
end

# Returns all features in the passed geojson
Expand Down

0 comments on commit 8b22fd6

Please sign in to comment.