14#include <GeographicLib/Geocentric.hpp>
15#include <GeographicLib/LocalCartesian.hpp>
16#include <GeographicLib/UTMUPS.hpp>
36 switch (
ctx.parameters.coordinate_frame)
40 auto proj = std::make_shared<GeographicLib::LocalCartesian>(
ctx.parameters.origin_latitude,
41 ctx.parameters.origin_longitude,
42 ctx.parameters.origin_altitude);
49 const int zone =
ctx.parameters.utm_zone;
50 const bool northp =
ctx.parameters.utm_north_hemisphere;
53 double gamma = std::numeric_limits<double>::quiet_NaN();
54 double k = std::numeric_limits<double>::quiet_NaN();
62 const auto&
earth = GeographicLib::Geocentric::WGS84();
70 if (!kml_file.is_open())
74 return std::unexpected(
message);
80 catch (
const std::exception&
e)
82 const std::string
message =
"Error generating KML file: " + std::string(
e.what());
84 return std::unexpected(
message);
88 const std::string
message =
"Unknown error occurred while generating KML file.";
90 return std::unexpected(
message);
The World class manages the simulator environment.
A class representing a vector in rectangular coordinates.
RealType x
The x component of the vector.
RealType z
The z component of the vector.
RealType y
The y component of the vector.
static std::expected< void, std::string > generateKml(const core::World &world, const std::string &outputKmlPath)
Generates a KML file from a pre-built simulation world.
KML file generator for geographical visualization of FERS scenarios.
Utility definitions and functions for generating KML files from simulation scenarios.
Header file for the logging system.
@ ERROR
Error level for error events.
@ UTM
Universal Transverse Mercator.
@ ENU
East-North-Up local tangent plane (default)
@ ECEF
Earth-Centered, Earth-Fixed.
Parameters params
Global simulation parameter state.
void generateKmlToStream(std::ostream &out, const core::World &world, const KmlContext &ctx)
Master entry point designed to convert the comprehensive simulation world state into a valid KML docu...
Defines the Parameters struct and provides methods for managing simulation parameters.
Context data required during KML generation.