| 218 | } |
| 219 | |
| 220 | PJ_XYZ pj_fwd3d(PJ_LPZ lpz, PJ *P) { |
| 221 | PJ_COORD coo = {{0, 0, 0, 0}}; |
| 222 | coo.lpz = lpz; |
| 223 | |
| 224 | const int last_errno = P->ctx->last_errno; |
| 225 | P->ctx->last_errno = 0; |
| 226 | |
| 227 | if (!P->skip_fwd_prepare) |
| 228 | fwd_prepare(P, coo); |
| 229 | if (HUGE_VAL == coo.v[0]) |
| 230 | return proj_coord_error().xyz; |
| 231 | |
| 232 | /* Do the transformation, using the lowest dimensional transformer feasible |
| 233 | */ |
| 234 | if (P->fwd3d) { |
| 235 | const auto xyz = P->fwd3d(coo.lpz, P); |
| 236 | coo.xyz = xyz; |
| 237 | } else if (P->fwd4d) |
| 238 | P->fwd4d(coo, P); |
| 239 | else if (P->fwd) { |
| 240 | const auto xy = P->fwd(coo.lp, P); |
| 241 | coo.xy = xy; |
| 242 | } else { |
| 243 | proj_errno_set(P, PROJ_ERR_OTHER_NO_INVERSE_OP); |
| 244 | return proj_coord_error().xyz; |
| 245 | } |
| 246 | if (HUGE_VAL == coo.v[0]) |
| 247 | return proj_coord_error().xyz; |
| 248 | |
| 249 | if (!P->skip_fwd_finalize) |
| 250 | fwd_finalize(P, coo); |
| 251 | |
| 252 | return error_or_coord(P, coo, last_errno).xyz; |
| 253 | } |
| 254 | |
| 255 | bool pj_fwd4d(PJ_COORD &coo, PJ *P) { |
| 256 |
no test coverage detected