10#include <isce3/except/Error.h>
12namespace isce3 {
namespace core {
39 : _ellipse(), _epsgcode(
code)
43 int code()
const {
return _epsgcode; }
58 virtual int forward(
const Vec3& llh, Vec3& xyz)
const = 0;
70 const int ret =
forward(llh, xyz);
72 throw isce3::except::RuntimeError(ISCE_SRCINFO(),
73 "Forward projection transformation failed");
85 virtual int inverse(
const Vec3& xyz, Vec3& llh)
const = 0;
97 const int ret =
inverse(xyz, llh);
99 throw isce3::except::RuntimeError(ISCE_SRCINFO(),
100 "Inverse projection transformation failed");
114 void print()
const override;
116 int forward(
const Vec3&, Vec3&)
const override;
118 int inverse(
const Vec3&, Vec3&)
const override;
123 std::cout <<
"Projection: LatLon" << std::endl
124 <<
"EPSG: " <<
code() << std::endl;
129 out[0] = in[0] * 180.0 / M_PI;
130 out[1] = in[1] * 180.0 / M_PI;
137 out[0] = in[0] * M_PI / 180.0;
138 out[1] = in[1] * M_PI / 180.0;
152 int forward(
const Vec3& llh, Vec3& xyz)
const;
155 int inverse(
const Vec3& xyz, Vec3& llh)
const;
160 std::cout <<
"Projection: Geocent" << std::endl
161 <<
"EPSG: " <<
code() << std::endl;
177 double cgb[6], cbg[6], utg[6], gtu[6];
184 void print()
const override;
187 int forward(
const Vec3& llh, Vec3& xyz)
const override;
190 int inverse(
const Vec3& xyz, Vec3& llh)
const override;
195 std::cout <<
"Projection: UTM" << std::endl
196 <<
"Zone: " << zone << (isnorth ?
"N" :
"S") << std::endl
197 <<
"EPSG: " <<
code() << std::endl;
208 double lat0, lon0, lat_ts, akm1, e;
215 void print()
const override;
218 int forward(
const Vec3&, Vec3&)
const override;
221 int inverse(
const Vec3&, Vec3&)
const override;
226 std::cout <<
"Projection: " << (isnorth ?
"North" :
"South")
227 <<
" Polar Stereographic" << std::endl
228 <<
"EPSG: " <<
code() << std::endl;
239 double lat_ts, k0, e, one_es, qp;
244 void print()
const override;
247 int forward(
const Vec3& llh, Vec3& xyz)
const override;
250 int inverse(
const Vec3& xyz, Vec3& llh)
const override;
255 std::cout <<
"Projection: Cylindrical Equal Area" << std::endl
256 <<
"EPSG: " <<
code() << std::endl;
262inline std::unique_ptr<ProjectionBase> makeProjection(
int epsg)
264 return std::unique_ptr<ProjectionBase>(createProj(epsg));
void print() const override
Print function for debugging.
Definition Projections.h:253
int forward(const Vec3 &llh, Vec3 &xyz) const override
Transform from llh (rad) to CEA (m)
Definition Projections.cpp:349
int inverse(const Vec3 &xyz, Vec3 &llh) const override
Transform from CEA (m) to LLH (rad)
Definition Projections.cpp:357
Data structure to store Ellipsoid information.
Definition Ellipsoid.h:20
void print() const
Print function for debugging.
Definition Projections.h:158
int forward(const Vec3 &llh, Vec3 &xyz) const
This is same as Ellipsoid::lonLatToXyz.
Definition Projections.cpp:10
int inverse(const Vec3 &xyz, Vec3 &llh) const
This is same as Ellipsoid::xyzToLonLat.
Definition Projections.cpp:18
void print() const override
Print function for debugging.
Definition Projections.h:121
int forward(const Vec3 &, Vec3 &) const override
Function for transforming from LLH.
Definition Projections.h:127
int inverse(const Vec3 &, Vec3 &) const override
Function for transforming to LLH.
Definition Projections.h:135
int inverse(const Vec3 &, Vec3 &) const override
Transform from Polar Stereo (m) to llh (rad)
Definition Projections.cpp:292
int forward(const Vec3 &, Vec3 &) const override
Transform from llh(rad) to Polar Stereo (m)
Definition Projections.cpp:278
void print() const override
Print function for debugging.
Definition Projections.h:224
Abstract base class for individual projections.
Definition Projections.h:21
Vec3 inverse(const Vec3 &xyz) const
Function for transforming to LLH.
Definition Projections.h:94
Vec3 forward(const Vec3 &llh) const
Function for transforming from LLH.
Definition Projections.h:67
virtual int inverse(const Vec3 &xyz, Vec3 &llh) const =0
Function for transforming to LLH.
virtual int forward(const Vec3 &llh, Vec3 &xyz) const =0
Function for transforming from LLH.
int code() const
Return EPSG code.
Definition Projections.h:43
ProjectionBase(int code)
Value constructor with EPSG code as input.
Definition Projections.h:38
const Ellipsoid & ellipsoid() const
Return underlying ellipsoid.
Definition Projections.h:46
virtual void print() const =0
Print function for debugging.
int inverse(const Vec3 &xyz, Vec3 &llh) const override
Transform from UTM(m) to llh (rad)
Definition Projections.cpp:202
int forward(const Vec3 &llh, Vec3 &xyz) const override
Transform from llh (rad) to UTM (m)
Definition Projections.cpp:171
void print() const override
Print function for debugging.
Definition Projections.h:193
base interpolator is an abstract base class
Definition BinarySearchFunc.cpp:5
Abstract base class for individual projections.
Definition gpuProjections.h:23