1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-09-29 23:41:05 +00:00
gnss-sdr/src/algorithms/PVT/libs/geojson_printer.h

59 lines
1.4 KiB
C
Raw Normal View History

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
*
* 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.
*
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
* 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
*/
#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>
/** \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
*
* See https://tools.ietf.org/html/rfc7946
2015-11-14 13:17:02 +00:00
*/
class GeoJSON_Printer
{
public:
explicit GeoJSON_Printer(const std::string& base_path = ".");
2015-11-14 13:17:02 +00:00
~GeoJSON_Printer();
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();
private:
std::ofstream geojson_file;
std::string filename_;
std::string geojson_base_path;
bool first_pos;
2015-11-14 13:17:02 +00:00
};
/** \} */
/** \} */
#endif // GNSS_SDR_GEOJSON_PRINTER_H