MCPcopy Create free account
hub / github.com/OSGeo/PROJ / pj_fwd

Function pj_fwd

src/fwd.cpp:185–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185PJ_XY pj_fwd(PJ_LP lp, PJ *P) {
186 PJ_COORD coo = {{0, 0, 0, 0}};
187 coo.lp = lp;
188
189 const int last_errno = P->ctx->last_errno;
190 P->ctx->last_errno = 0;
191
192 if (!P->skip_fwd_prepare)
193 fwd_prepare(P, coo);
194 if (HUGE_VAL == coo.v[0] || HUGE_VAL == coo.v[1])
195 return proj_coord_error().xy;
196
197 /* Do the transformation, using the lowest dimensional transformer available
198 */
199 if (P->fwd) {
200 const auto xy = P->fwd(coo.lp, P);
201 coo.xy = xy;
202 } else if (P->fwd3d) {
203 const auto xyz = P->fwd3d(coo.lpz, P);
204 coo.xyz = xyz;
205 } else if (P->fwd4d)
206 P->fwd4d(coo, P);
207 else {
208 proj_errno_set(P, PROJ_ERR_OTHER_NO_INVERSE_OP);
209 return proj_coord_error().xy;
210 }
211 if (HUGE_VAL == coo.v[0])
212 return proj_coord_error().xy;
213
214 if (!P->skip_fwd_finalize)
215 fwd_finalize(P, coo);
216
217 return error_or_coord(P, coo, last_errno).xy;
218}
219
220PJ_XYZ pj_fwd3d(PJ_LPZ lpz, PJ *P) {
221 PJ_COORD coo = {{0, 0, 0, 0}};

Callers 2

pj_approx_2D_transFunction · 0.85
vprocessFunction · 0.85

Calls 5

fwd_prepareFunction · 0.85
proj_coord_errorFunction · 0.85
proj_errno_setFunction · 0.85
fwd_finalizeFunction · 0.85
error_or_coordFunction · 0.70

Tested by

no test coverage detected