diff options
Diffstat (limited to 'server/src/api.cpp')
| -rw-r--r-- | server/src/api.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/server/src/api.cpp b/server/src/api.cpp index f1ca24e..9a51690 100644 --- a/server/src/api.cpp +++ b/server/src/api.cpp | |||
| @@ -141,20 +141,15 @@ handler::handler(log::logger const& l, datex2::situation_publication pub) | |||
| 141 | auto const dur_build_s = chrono::duration<double>{after_build - before_build}; | 141 | auto const dur_build_s = chrono::duration<double>{after_build - before_build}; |
| 142 | l_.info("Indexes built in {}", dur_build_s); | 142 | l_.info("Indexes built in {}", dur_build_s); |
| 143 | l_.info("BLSE index size: {}", blse_index_.size()); | 143 | l_.info("BLSE index size: {}", blse_index_.size()); |
| 144 | l_.info("Point index size: {}", bpe_index_.size()); | 144 | l_.info("BPE index size: {}", bpe_index_.size()); |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | auto handler::process_gpx(trace::id trace_id, gpx::file&& gpx_file) | 147 | auto handler::process_gpx( |
| 148 | trace::id trace_id, gpx::file&& gpx_file, time::period_seq check_periods) | ||
| 148 | -> std::optional<process_gpx_result> | 149 | -> std::optional<process_gpx_result> |
| 149 | { | 150 | { |
| 150 | auto l = l_.with("trace_id", trace_id.as_string()); | 151 | auto l = l_.with("trace_id", trace_id.as_string()); |
| 151 | 152 | ||
| 152 | auto const now = chrono::utc_clock::now(); | ||
| 153 | auto const relevant = std::initializer_list<time::period>{ | ||
| 154 | time::period{now - chrono::days(7), now + chrono::days(7)} | ||
| 155 | }; | ||
| 156 | auto const check_periods = time::period_seq{relevant.begin(), relevant.end()}; | ||
| 157 | |||
| 158 | // TODO: eliminate use of overlap segments | 153 | // TODO: eliminate use of overlap segments |
| 159 | auto segments = std::vector<geo::utm::zonable_wgs84_linestring>{}; | 154 | auto segments = std::vector<geo::utm::zonable_wgs84_linestring>{}; |
| 160 | for (auto const& track : gpx_file.tracks) | 155 | for (auto const& track : gpx_file.tracks) |