Fixposition SDK 0.0.0-heads/main-0-g200d201
Collection of c++ libraries and apps for use with Fixposition products on Linux
Loading...
Searching...
No Matches
fpsdk::common::trafo::Transformer Class Reference

"Universal" coordinate transformer, backed by PROJ More...

#include <trafo.hpp>

Inheritance diagram for fpsdk::common::trafo::Transformer:
[legend]
Collaboration diagram for fpsdk::common::trafo::Transformer:
[legend]

Public Member Functions

 Transformer (const std::string &name="")
 Constructor.
bool Init (const std::string &source_crs, const std::string &target_crs)
 Initialise transformer.
bool Transform (Eigen::Vector3d &inout, const bool inv=false)
 Transform coordinates.
bool Transform (const Eigen::Vector3d &in, Eigen::Vector3d &out, const bool inv=false)
 Transform coordinates.
bool Transform (const Eigen::Vector4d &in, Eigen::Vector4d &out, const bool inv=false)
 Transform coordinates (with time).

Detailed Description

"Universal" coordinate transformer, backed by PROJ

Note
This is only available if compiled with PROJ, see Dependencies.

Definition at line 219 of file trafo.hpp.

Constructor & Destructor Documentation

◆ Transformer()

fpsdk::common::trafo::Transformer::Transformer ( const std::string & name = "")
explicit

Constructor.

Parameters
[in]nameOptional name, for debugging

References Transformer().

Referenced by Transformer().

Member Function Documentation

◆ Init()

bool fpsdk::common::trafo::Transformer::Init ( const std::string & source_crs,
const std::string & target_crs )

Initialise transformer.

The source and target CRS specification can be anything that proj_create_crs_to_crs() understands (see https://proj.org/en/9.4/development/reference/functions.html#c.proj_create_crs_to_crs). You may have to change the PROJ configuration (proj.ini) and/or update some PROJ data yourself to support some CRS. See the PROJ documentation for details (see https://proj.org/en/9.4/resource_files.html).

Parameters
[in]source_crsSource coordinate reference system, e.g. "EPSG:4326"
[in]target_crsTarget coordinate reference system, e.g. "EPSG:2056"
Returns
true on success, false otherwise (bad params, missing data, ...)

◆ Transform() [1/3]

bool fpsdk::common::trafo::Transformer::Transform ( Eigen::Vector3d & inout,
const bool inv = false )

Transform coordinates.

Parameters
[in,out]inoutCoordinates to transform, replaced with result
[in]invDo the inverse transformation (true), default is forward (false)
Returns
true on success, false otherwise

◆ Transform() [2/3]

bool fpsdk::common::trafo::Transformer::Transform ( const Eigen::Vector3d & in,
Eigen::Vector3d & out,
const bool inv = false )

Transform coordinates.

Parameters
[in]inCoordinates to transform
[out]outTransformed coordinates
[in]invDo the inverse transformation (true), default is forward (false)
Returns
true on success, false otherwise

◆ Transform() [3/3]

bool fpsdk::common::trafo::Transformer::Transform ( const Eigen::Vector4d & in,
Eigen::Vector4d & out,
const bool inv = false )

Transform coordinates (with time).

Parameters
[in]inCoordinates to transform (with time)
[out]outTransformed coordinates (with time)
[in]invDo the inverse transformation (true), default is forward (false)
Returns
true on success, false otherwise

The documentation for this class was generated from the following file:
  • fpsdk_common/include/fpsdk_common/trafo.hpp