PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ printPA()

void printPA ( POINTARRAY pa)

Definition at line 611 of file lwgeom_api.c.

References POINTARRAY::flags, FLAGS_GET_M, FLAGS_NDIMS, getPoint4d_p(), lwnotice(), POINT4D::m, POINTARRAY::npoints, ptarray_point_size(), POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by printLWCIRCSTRING(), printLWLINE(), printLWPOINT(), printLWPOLY(), printLWPSURFACE(), printLWTIN(), and printLWTRIANGLE().

612 {
613  int t;
614  POINT4D pt;
615  char *mflag;
616 
617 
618  if ( FLAGS_GET_M(pa->flags) ) mflag = "M";
619  else mflag = "";
620 
621  lwnotice(" POINTARRAY%s{", mflag);
622  lwnotice(" ndims=%i, ptsize=%i",
624  lwnotice(" npoints = %i", pa->npoints);
625 
626  for (t =0; t<pa->npoints; t++)
627  {
628  getPoint4d_p(pa, t, &pt);
629  if (FLAGS_NDIMS(pa->flags) == 2)
630  {
631  lwnotice(" %i : %lf,%lf",t,pt.x,pt.y);
632  }
633  if (FLAGS_NDIMS(pa->flags) == 3)
634  {
635  lwnotice(" %i : %lf,%lf,%lf",t,pt.x,pt.y,pt.z);
636  }
637  if (FLAGS_NDIMS(pa->flags) == 4)
638  {
639  lwnotice(" %i : %lf,%lf,%lf,%lf",t,pt.x,pt.y,pt.z,pt.m);
640  }
641  }
642 
643  lwnotice(" }");
644 }
double x
Definition: liblwgeom.h:351
double m
Definition: liblwgeom.h:351
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:89
int npoints
Definition: liblwgeom.h:370
uint8_t flags
Definition: liblwgeom.h:368
int ptarray_point_size(const POINTARRAY *pa)
Definition: ptarray.c:54
double z
Definition: liblwgeom.h:351
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *op)
Definition: lwgeom_api.c:244
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
double y
Definition: liblwgeom.h:351
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:151
Here is the call graph for this function:
Here is the caller graph for this function: