GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
geojson_printer.h
Go to the documentation of this file.
1 /*!
2  * \file geojson_printer.h
3  * \brief Interface of a class that prints PVT solutions in GeoJSON format
4  * \author Carles Fernandez-Prades, 2015. cfernandez(at)cttc.es
5  *
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 
22 #ifndef GNSS_SDR_GEOJSON_PRINTER_H
23 #define GNSS_SDR_GEOJSON_PRINTER_H
24 
25 
26 #include <fstream>
27 #include <string>
28 
29 class Pvt_Solution;
30 
31 /*!
32  * \brief Prints PVT solutions in GeoJSON format file
33  *
34  * See https://tools.ietf.org/html/rfc7946
35  */
37 {
38 public:
39  explicit GeoJSON_Printer(const std::string& base_path = ".");
40  ~GeoJSON_Printer();
41  bool set_headers(const std::string& filename, bool time_tag_name = true);
42  bool print_position(const Pvt_Solution* const position, bool print_average_values);
43  bool close_file();
44 
45 private:
46  std::ofstream geojson_file;
47  std::string filename_;
48  std::string geojson_base_path;
49  bool first_pos;
50 };
51 
52 #endif
Prints PVT solutions in GeoJSON format file.
Base class for a PVT solution.
Definition: pvt_solution.h:33