496{
497 uint32_t i;
499 size_t n_converted;
504
505
506 if (proj_angular_input(pj->
pj, PJ_FWD))
507 {
508 for (i = 0; i < pa->
npoints; i++)
509 {
512 }
513 }
514
517
518 if (n_points == 1)
519 {
520
521 PJ_XYZT v = {pa_double[0], pa_double[1], has_z ? pa_double[2] : 0.0, 0.0};
522 PJ_COORD t = proj_trans(pj->
pj, PJ_FWD, (PJ_COORD)v);
523
524 int pj_errno_val = proj_errno(pj->
pj);
525 if (pj_errno_val)
526 {
527 lwerror(
"transform: %s (%d)", proj_errno_string(pj_errno_val), pj_errno_val);
529 }
530 pa_double[0] = ((PJ_XYZT)t.xyzt).x;
531 pa_double[1] = ((PJ_XYZT)t.xyzt).y;
532 if (has_z)
533 pa_double[2] = ((PJ_XYZT)t.xyzt).z;
534 }
535 else
536 {
537
538
539
540
541
542
543
544
545 n_converted = proj_trans_generic(pj->
pj,
546 PJ_FWD,
547 pa_double,
548 point_size,
549 n_points,
550 pa_double + 1,
551 point_size,
552 n_points,
553 has_z ? pa_double + 2 : NULL,
554 has_z ? point_size : 0,
555 has_z ? n_points : 0,
556 NULL,
557 0,
558 0
559 );
560
561 if (n_converted != n_points)
562 {
563 lwerror(
"ptarray_transform: converted (%d) != input (%d)", n_converted, n_points);
565 }
566
567 int pj_errno_val = proj_errno(pj->
pj);
568 if (pj_errno_val)
569 {
570 lwerror(
"transform: %s (%d)", proj_errno_string(pj_errno_val), pj_errno_val);
572 }
573 }
574
577
578
579 if (proj_angular_output(pj->
pj, PJ_FWD))
580 {
581 for (i = 0; i < pa->
npoints; i++)
582 {
585 }
586 }
587
589}
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
int ptarray_has_z(const POINTARRAY *pa)
void ptarray_swap_ordinates(POINTARRAY *pa, LWORD o1, LWORD o2)
Swap ordinate values o1 and o2 on a given POINTARRAY.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static size_t ptarray_point_size(const POINTARRAY *pa)
uint8_t * serialized_pointlist