PostGIS  2.2.7dev-r@@SVN_REVISION@@
void printPA ( POINTARRAY pa)

Definition at line 598 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().

599 {
600  int t;
601  POINT4D pt;
602  char *mflag;
603 
604 
605  if ( FLAGS_GET_M(pa->flags) ) mflag = "M";
606  else mflag = "";
607 
608  lwnotice(" POINTARRAY%s{", mflag);
609  lwnotice(" ndims=%i, ptsize=%i",
611  lwnotice(" npoints = %i", pa->npoints);
612 
613  for (t =0; t<pa->npoints; t++)
614  {
615  getPoint4d_p(pa, t, &pt);
616  if (FLAGS_NDIMS(pa->flags) == 2)
617  {
618  lwnotice(" %i : %lf,%lf",t,pt.x,pt.y);
619  }
620  if (FLAGS_NDIMS(pa->flags) == 3)
621  {
622  lwnotice(" %i : %lf,%lf,%lf",t,pt.x,pt.y,pt.z);
623  }
624  if (FLAGS_NDIMS(pa->flags) == 4)
625  {
626  lwnotice(" %i : %lf,%lf,%lf,%lf",t,pt.x,pt.y,pt.z,pt.m);
627  }
628  }
629 
630  lwnotice(" }");
631 }
double x
Definition: liblwgeom.h:336
double m
Definition: liblwgeom.h:336
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:61
int npoints
Definition: liblwgeom.h:355
uint8_t flags
Definition: liblwgeom.h:353
int ptarray_point_size(const POINTARRAY *pa)
Definition: ptarray.c:54
double z
Definition: liblwgeom.h:336
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *op)
Definition: lwgeom_api.c:231
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
double y
Definition: liblwgeom.h:336
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:136

Here is the call graph for this function:

Here is the caller graph for this function: