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.
| 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. |
| 39 | MyPJ_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 |
| 58 | PJ_CONTEXT* my_proj_context_create() { |
no outgoing calls
no test coverage detected