From: Anton Khorev Date: Mon, 23 Sep 2024 12:56:53 +0000 (+0300) Subject: Store latitudes and longitudes during gpx parsing X-Git-Tag: live~148^2~1 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/ba732128a78e487df5cae1c53857e3f7279d3ec1?ds=sidebyside;hp=-c Store latitudes and longitudes during gpx parsing --- ba732128a78e487df5cae1c53857e3f7279d3ec1 diff --git a/lib/gpx.rb b/lib/gpx.rb index 1bf7764ec..bae975b61 100644 --- a/lib/gpx.rb +++ b/lib/gpx.rb @@ -31,6 +31,8 @@ module GPX point.altitude ||= 0 yield point @actual_points += 1 + @lats << point.latitude + @lons << point.longitude elsif reader.name == "trkseg" @tracksegs += 1 end @@ -44,6 +46,8 @@ module GPX @possible_points = 0 @actual_points = 0 @tracksegs = 0 + @lats = [] + @lons = [] begin Archive::Reader.open_filename(@file).each_entry_with_data do |entry, data|