PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ printPA()

void printPA ( POINTARRAY pa)

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

473 {
474  int t;
475  POINT4D pt;
476  char *mflag;
477 
478 
479  if ( FLAGS_GET_M(pa->flags) ) mflag = "M";
480  else mflag = "";
481 
482  lwnotice(" POINTARRAY%s{", mflag);
483  lwnotice(" ndims=%i, ptsize=%i",
485  lwnotice(" npoints = %i", pa->npoints);
486 
487  for (t =0; t<pa->npoints; t++)
488  {
489  getPoint4d_p(pa, t, &pt);
490  if (FLAGS_NDIMS(pa->flags) == 2)
491  {
492  lwnotice(" %i : %lf,%lf",t,pt.x,pt.y);
493  }
494  if (FLAGS_NDIMS(pa->flags) == 3)
495  {
496  lwnotice(" %i : %lf,%lf,%lf",t,pt.x,pt.y,pt.z);
497  }
498  if (FLAGS_NDIMS(pa->flags) == 4)
499  {
500  lwnotice(" %i : %lf,%lf,%lf,%lf",t,pt.x,pt.y,pt.z,pt.m);
501  }
502  }
503 
504  lwnotice(" }");
505 }
double x
Definition: liblwgeom.h:352
double m
Definition: liblwgeom.h:352
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:177
int npoints
Definition: liblwgeom.h:371
uint8_t flags
Definition: liblwgeom.h:369
int ptarray_point_size(const POINTARRAY *pa)
Definition: ptarray.c:54
double z
Definition: liblwgeom.h:352
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *op)
Definition: lwgeom_api.c:122
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
double y
Definition: liblwgeom.h:352
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:152
Here is the call graph for this function:
Here is the caller graph for this function: