7#include "common/geodetic/geodetic_coordinates.h"
8#include "nlohmann/json.hpp"
13#include "standard/proj.h"
14#include "tps/latlontps_proj.h"
41 PROJ_THINPLATESPLINE = 3,
58 bool fwd_valid =
false;
59 bool rev_valid =
false;
60 proj_type_t fwd_type = PROJ_INVALID;
61 proj_type_t inv_type = PROJ_INVALID;
68 std::shared_ptr<SatelliteRaytracer> raytracer;
71 std::shared_ptr<satdump::proj::LatLonTpsProjHelper> tps_fwd;
73 double proj_timestamp = -1;
76 bool has_2nd_transform =
false;
94 bool init(
bool fwd,
bool inv);
104 bool forward(geodetic::geodetic_coords_t pos,
double &x,
double &y,
bool except =
true);
117 bool inverse(
double x,
double y, geodetic::geodetic_coords_t &pos,
double *otime =
nullptr,
bool except =
true);
120 void to_json(nlohmann::json &j)
const;
121 void from_json(
const nlohmann::json &j);
123 friend void to_json(nlohmann::json &j,
const Projection &v) { v.to_json(j); }
124 friend void from_json(
const nlohmann::json &j, Projection &v) { v.from_json(j); }
Extremely generic class to handle projections.
Definition projection.h:34
bool inverse(double x, double y, geodetic::geodetic_coords_t &pos, double *otime=nullptr, bool except=true)
Run forward (X/Y => Lat/Lon) projection.
Definition projection.cpp:139
bool forward(geodetic::geodetic_coords_t pos, double &x, double &y, bool except=true)
Run forward (Lat/Lon => X/Y) projection.
Definition projection.cpp:110
proj_type_t getInvType()
Get inverse (X/Y => Lat/Lon) projection type.
Definition projection.h:54
proj_type_t getFwdType()
Get forward (Lat/Lon => X/Y) projection type.
Definition projection.h:48
bool init(bool fwd, bool inv)
Initialize projection, to allow using it to perform the math :-) Disabling doesn't guarantee they won...
Definition projection.cpp:20