From 8b22fd6125f22b42c22b3ce6d3e56107349ab445 Mon Sep 17 00:00:00 2001 From: Ty Rauber Date: Thu, 11 Jul 2024 13:28:42 +0200 Subject: [PATCH] feat: add point[3] as time 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 --- lib/gpx/geo_json.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/gpx/geo_json.rb b/lib/gpx/geo_json.rb index 2c9f263..327206c 100644 --- a/lib/gpx/geo_json.rb +++ b/lib/gpx/geo_json.rb @@ -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 @@ -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