mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Fix GPX export
This commit is contained in:
parent
d517b72f69
commit
f50b11166b
5 changed files with 15 additions and 4 deletions
|
|
@ -1 +1 @@
|
|||
0.14.4
|
||||
0.14.5
|
||||
|
|
|
|||
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [0.14.5] - 2024-09-28
|
||||
|
||||
### Fixed
|
||||
|
||||
- GPX export now finishes correctly and does not throw an error in the end
|
||||
|
||||
### Changed
|
||||
|
||||
- Map layers from Stadia were disabled for now due to necessary API key
|
||||
|
||||
# [0.14.4] - 2024-09-24
|
||||
|
||||
### Fixed
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -12,7 +12,7 @@ class Points::GpxSerializer
|
|||
gpx.waypoints << GPX::Waypoint.new(
|
||||
lat: point.latitude.to_f,
|
||||
lon: point.longitude.to_f,
|
||||
time: point.recorded_at.strftime('%FT%R:%SZ'),
|
||||
time: point.recorded_at,
|
||||
ele: point.altitude.to_f
|
||||
)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class Exports::Create
|
|||
def points_data(points)
|
||||
case file_format.to_sym
|
||||
when :json then process_geojson_export(points)
|
||||
when :gpx then process_gpx_export(points)
|
||||
when :gpx then process_gpx_export(points)
|
||||
else raise ArgumentError, "Unsupported file format: #{file_format}"
|
||||
end
|
||||
end
|
||||
|
|
@ -75,6 +75,7 @@ class Exports::Create
|
|||
dir_path = Rails.root.join('public', 'exports')
|
||||
Dir.mkdir(dir_path) unless Dir.exist?(dir_path)
|
||||
file_path = dir_path.join("#{export.name}.#{file_format}")
|
||||
|
||||
File.open(file_path, 'w') { |file| file.write(data) }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue