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

Function fwd_finalize

src/fwd.cpp:123–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static void fwd_finalize(PJ *P, PJ_COORD &coo) {
124
125 switch (OUTPUT_UNITS) {
126
127 /* Handle false eastings/northings and non-metric linear units */
128 case PJ_IO_UNITS_CARTESIAN:
129
130 if (P->is_geocent) {
131 coo = proj_trans(P->cart, PJ_FWD, coo);
132 }
133 coo.xyz.x *= P->fr_meter;
134 coo.xyz.y *= P->fr_meter;
135 coo.xyz.z *= P->fr_meter;
136
137 break;
138
139 /* Classic proj.4 functions return plane coordinates in units of the
140 * semimajor axis */
141 case PJ_IO_UNITS_CLASSIC:
142 coo.xy.x *= P->a;
143 coo.xy.y *= P->a;
144 PROJ_FALLTHROUGH;
145
146 /* to continue processing in common with PJ_IO_UNITS_PROJECTED */
147 case PJ_IO_UNITS_PROJECTED:
148 coo.xyz.x = P->fr_meter * (coo.xyz.x + P->x0);
149 coo.xyz.y = P->fr_meter * (coo.xyz.y + P->y0);
150 coo.xyz.z = P->vfr_meter * (coo.xyz.z + P->z0);
151 break;
152
153 case PJ_IO_UNITS_WHATEVER:
154 break;
155
156 case PJ_IO_UNITS_DEGREES:
157 break;
158
159 case PJ_IO_UNITS_RADIANS:
160 coo.lpz.z = P->vfr_meter * (coo.lpz.z + P->z0);
161
162 if (P->is_long_wrap_set) {
163 if (coo.lpz.lam != HUGE_VAL) {
164 coo.lpz.lam = P->long_wrap_center +
165 adjlon(coo.lpz.lam - P->long_wrap_center);
166 }
167 }
168
169 break;
170 }
171
172 if (P->axisswap)
173 coo = proj_trans(P->axisswap, PJ_FWD, coo);
174}
175
176static inline PJ_COORD error_or_coord(PJ *P, PJ_COORD coord, int last_errno) {
177 if (P->ctx->last_errno)

Callers 3

pj_fwdFunction · 0.85
pj_fwd3dFunction · 0.85
pj_fwd4dFunction · 0.85

Calls 2

proj_transFunction · 0.85
adjlonFunction · 0.85

Tested by

no test coverage detected