MCPcopy Create free account
hub / github.com/LAStools/LAStools / transform_point

Function transform_point

src/proj_wrapper.cpp:39–55  ·  view source on GitHub ↗

Performs an ABI-safe PROJ transformation of (x, y, z, t) via PJ in the PJ_DIRECTION direction and returns the result as MyPJ_COORD.

Source from the content-addressed store, hash-verified

37
38/// Performs an ABI-safe PROJ transformation of (x, y, z, t) via PJ in the PJ_DIRECTION direction and returns the result as MyPJ_COORD.
39MyPJ_COORD transform_point(PJ* P, PJ_DIRECTION direction, double x, double y, double z, double t) {
40 if (!proj_coord_ptr || !proj_trans_ptr) {
41 MyPJ_COORD err = {0, 0, 0, 0};
42 return err;
43 }
44
45 PROJ_COORD_OPAQUE in_coord = proj_coord_ptr(x, y, z, t);
46 PROJ_COORD_OPAQUE out_coord = proj_trans_ptr(P, direction, in_coord);
47
48 MyPJ_COORD result;
49 result.x = out_coord.v[0];
50 result.y = out_coord.v[1];
51 result.z = out_coord.v[2];
52 result.t = out_coord.v[3];
53
54 return result;
55}
56
57/// Wrapper for proj_context_create
58PJ_CONTEXT* my_proj_context_create() {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected