PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgml2_ptarray()

static void asgml2_ptarray ( stringbuffer_t sb,
const POINTARRAY pa,
const GML_Options opts 
)
static

Definition at line 51 of file lwout_gml.c.

52 {
53  uint32_t i;
54  if ( ! FLAGS_GET_Z(pa->flags) )
55  {
56  for (i=0; i<pa->npoints; i++)
57  {
58  const POINT2D *pt = getPoint2d_cp(pa, i);
59  if (i) stringbuffer_append_char(sb, ' ');
60  stringbuffer_append_double(sb, pt->x, opts->precision);
61  stringbuffer_append_char(sb, ',');
62  stringbuffer_append_double(sb, pt->y, opts->precision);
63  }
64  }
65  else
66  {
67  for (i=0; i<pa->npoints; i++)
68  {
69  const POINT3D *pt = getPoint3d_cp(pa, i);
70  if (i) stringbuffer_append_char(sb, ' ');
71  stringbuffer_append_double(sb, pt->x, opts->precision);
72  stringbuffer_append_char(sb, ',');
73  stringbuffer_append_double(sb, pt->y, opts->precision);
74  stringbuffer_append_char(sb, ',');
75  stringbuffer_append_double(sb, pt->z, opts->precision);
76  }
77  }
78 }
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:165
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:101
static const POINT3D * getPoint3d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT3D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:113
opts
Definition: ovdump.py:45
static void stringbuffer_append_double(stringbuffer_t *s, double d, int precision)
Definition: stringbuffer.h:112
static void stringbuffer_append_char(stringbuffer_t *s, char c)
Definition: stringbuffer.h:119
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390
double z
Definition: liblwgeom.h:402
double x
Definition: liblwgeom.h:402
double y
Definition: liblwgeom.h:402
lwflags_t flags
Definition: liblwgeom.h:431
uint32_t npoints
Definition: liblwgeom.h:427

References POINTARRAY::flags, FLAGS_GET_Z, getPoint2d_cp(), getPoint3d_cp(), POINTARRAY::npoints, ovdump::opts, stringbuffer_append_char(), stringbuffer_append_double(), POINT2D::x, POINT3D::x, POINT2D::y, POINT3D::y, and POINT3D::z.

Referenced by asgml2_gbox(), asgml2_line(), asgml2_point(), and asgml2_poly().

Here is the call graph for this function:
Here is the caller graph for this function: