2015-11-14 13:17:02 +00:00
|
|
|
/*!
|
|
|
|
* \file geojson_printer.h
|
|
|
|
* \brief Interface of a class that prints PVT solutions in GeoJSON format
|
|
|
|
* \author Carles Fernandez-Prades, 2015. cfernandez(at)cttc.es
|
|
|
|
*
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-11-14 13:17:02 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2015-11-14 13:17:02 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2015-11-14 13:17:02 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-11-14 13:17:02 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GEOJSON_PRINTER_H
|
|
|
|
#define GNSS_SDR_GEOJSON_PRINTER_H
|
2015-11-14 13:17:02 +00:00
|
|
|
|
2019-03-06 17:45:27 +00:00
|
|
|
|
2015-11-14 13:17:02 +00:00
|
|
|
#include <fstream>
|
|
|
|
#include <string>
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup PVT
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup PVT_libs
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2019-03-06 17:45:27 +00:00
|
|
|
class Pvt_Solution;
|
2015-11-14 13:17:02 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Prints PVT solutions in GeoJSON format file
|
|
|
|
*
|
2020-02-05 20:24:46 +00:00
|
|
|
* See https://tools.ietf.org/html/rfc7946
|
2015-11-14 13:17:02 +00:00
|
|
|
*/
|
|
|
|
class GeoJSON_Printer
|
|
|
|
{
|
|
|
|
public:
|
2019-08-23 19:25:44 +00:00
|
|
|
explicit GeoJSON_Printer(const std::string& base_path = ".");
|
2015-11-14 13:17:02 +00:00
|
|
|
~GeoJSON_Printer();
|
2018-12-02 14:42:38 +00:00
|
|
|
bool set_headers(const std::string& filename, bool time_tag_name = true);
|
2020-07-26 21:56:36 +00:00
|
|
|
bool print_position(const Pvt_Solution* const position, bool print_average_values);
|
2015-11-14 13:17:02 +00:00
|
|
|
bool close_file();
|
2019-07-01 21:44:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
std::ofstream geojson_file;
|
|
|
|
std::string filename_;
|
|
|
|
std::string geojson_base_path;
|
2020-06-23 07:47:58 +00:00
|
|
|
bool first_pos;
|
2015-11-14 13:17:02 +00:00
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
|
|
|
#endif // GNSS_SDR_GEOJSON_PRINTER_H
|