MCPcopy Create free account
hub / github.com/Kitware/VTK / pj_inv

Function pj_inv

ThirdParty/libproj/vtklibproj/src/inv.cpp:146–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144
145
146PJ_LP pj_inv(PJ_XY xy, PJ *P) {
147 int last_errno;
148 PJ_COORD coo = {{0,0,0,0}};
149 coo.xy = xy;
150
151 last_errno = proj_errno_reset(P);
152
153 if (!P->skip_inv_prepare)
154 coo = inv_prepare (P, coo);
155 if (HUGE_VAL==coo.v[0])
156 return proj_coord_error ().lp;
157
158 /* Do the transformation, using the lowest dimensional transformer available */
159 if (P->inv)
160 coo.lp = P->inv(coo.xy, P);
161 else if (P->inv3d)
162 coo.lpz = P->inv3d (coo.xyz, P);
163 else if (P->inv4d)
164 coo = P->inv4d (coo, P);
165 else {
166 proj_errno_set (P, PROJ_ERR_OTHER_NO_INVERSE_OP);
167 return proj_coord_error ().lp;
168 }
169 if (HUGE_VAL==coo.v[0])
170 return proj_coord_error ().lp;
171
172 if (!P->skip_inv_finalize)
173 coo = inv_finalize (P, coo);
174
175 return error_or_coord(P, coo, last_errno).lp;
176}
177
178
179

Callers 1

pj_approx_2D_transFunction · 0.85

Calls 6

proj_errno_resetFunction · 0.85
inv_prepareFunction · 0.85
proj_coord_errorFunction · 0.85
proj_errno_setFunction · 0.85
inv_finalizeFunction · 0.85
error_or_coordFunction · 0.70

Tested by

no test coverage detected