PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ printPA()

void printPA ( POINTARRAY pa)

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

497 {
498  uint32_t t;
499  POINT4D pt;
500  char *mflag;
501 
502 
503  if ( FLAGS_GET_M(pa->flags) ) mflag = "M";
504  else mflag = "";
505 
506  lwnotice(" POINTARRAY%s{", mflag);
507  lwnotice(" ndims=%i, ptsize=%i",
509  lwnotice(" npoints = %i", pa->npoints);
510 
511  for (t =0; t<pa->npoints; t++)
512  {
513  getPoint4d_p(pa, t, &pt);
514  if (FLAGS_NDIMS(pa->flags) == 2)
515  {
516  lwnotice(" %i : %lf,%lf",t,pt.x,pt.y);
517  }
518  if (FLAGS_NDIMS(pa->flags) == 3)
519  {
520  lwnotice(" %i : %lf,%lf,%lf",t,pt.x,pt.y,pt.z);
521  }
522  if (FLAGS_NDIMS(pa->flags) == 4)
523  {
524  lwnotice(" %i : %lf,%lf,%lf,%lf",t,pt.x,pt.y,pt.z,pt.m);
525  }
526  }
527 
528  lwnotice(" }");
529 }
double x
Definition: liblwgeom.h:354
size_t ptarray_point_size(const POINTARRAY *pa)
Definition: ptarray.c:54
double m
Definition: liblwgeom.h:354
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:177
unsigned int uint32_t
Definition: uthash.h:78
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *op)
Definition: lwgeom_api.c:113
uint8_t flags
Definition: liblwgeom.h:371
double z
Definition: liblwgeom.h:354
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
double y
Definition: liblwgeom.h:354
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:151
uint32_t npoints
Definition: liblwgeom.h:373
Here is the call graph for this function:
Here is the caller graph for this function: