diff --git a/app.rb b/app.rb index 2a7a216..ec10768 100644 --- a/app.rb +++ b/app.rb @@ -356,13 +356,24 @@ module Maptool bbox = %w[south west north east].map { |key| params[key].to_s } halt 400, json(error: "south, west, north, east are required") if bbox.any?(&:empty?) + south, west, north, east = bbox.map(&:to_f) begin - geojson = Plugins.run(PLUGINS_DIR, params[:name], bbox.map(&:to_f)) + geojson = Plugins.run(PLUGINS_DIR, params[:name], [south, west, north, east]) rescue Plugins::RunError => e halt 502, json(error: e.message) end - path = GPX_STORE.save(folder: "", filename: "#{params[:name]}.geojson", io: StringIO.new(JSON.generate(geojson))) + # Filename carries the area's center and the run's timestamp (same + # idea as a p4n2gpx export's own "p4n_area____