231{
232 uint32_t i;
234 size_t n_converted;
239
241
242
243 if (proj_angular_input(pj->
pj, direction))
244 {
245 for (i = 0; i < pa->
npoints; i++)
246 {
250 }
251 }
252
253 if (n_points == 1)
254 {
255
256 PJ_XYZT v = {pa_double[0], pa_double[1], has_z ? pa_double[2] : 0.0, 0.0};
257 PJ_COORD c;
258 c.xyzt = v;
259 PJ_COORD t = proj_trans(pj->
pj, direction, c);
260
261 int pj_errno_val = proj_errno_reset(pj->
pj);
262 if (pj_errno_val)
263 {
264 lwerror(
"transform: %s (%d)", proj_errno_string(pj_errno_val), pj_errno_val);
266 }
267 pa_double[0] = (t.xyzt).x;
268 pa_double[1] = (t.xyzt).y;
269 if (has_z)
270 pa_double[2] = (t.xyzt).z;
271 }
272 else
273 {
274
275
276
277
278
279
280
281
282 n_converted = proj_trans_generic(pj->
pj,
283 direction,
284 pa_double,
285 point_size,
286 n_points,
287 pa_double + 1,
288 point_size,
289 n_points,
290 has_z ? pa_double + 2 : NULL,
291 has_z ? point_size : 0,
292 has_z ? n_points : 0,
293 NULL,
294 0,
295 0
296 );
297
298 if (n_converted != n_points)
299 {
300 lwerror(
"ptarray_transform: converted (%zu) != input (%zu)", n_converted, n_points);
302 }
303
304 int pj_errno_val = proj_errno_reset(pj->
pj);
305 if (pj_errno_val)
306 {
307 lwerror(
"transform: %s (%d)", proj_errno_string(pj_errno_val), pj_errno_val);
309 }
310 }
311
312
313 if (proj_angular_output(pj->
pj, direction))
314 {
315 for (i = 0; i < pa->
npoints; i++)
316 {
320 }
321 }
322
324}
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
int ptarray_has_z(const POINTARRAY *pa)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static size_t ptarray_point_size(const POINTARRAY *pa)
uint8_t * serialized_pointlist