PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asgml3_ptarray()

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

Definition at line 112 of file lwout_gml.c.

113 {
114  uint32_t i;
115  if ( ! FLAGS_GET_Z(pa->flags) )
116  {
117  for (i=0; i<pa->npoints; i++)
118  {
119  const POINT2D *pt = getPoint2d_cp(pa, i);
120  if (i) stringbuffer_append_char(sb, ' ');
121  if (IS_DEGREE(opts->opts))
122  {
123  stringbuffer_append_double(sb, pt->y, opts->precision);
124  stringbuffer_append_char(sb, ' ');
125  stringbuffer_append_double(sb, pt->x, opts->precision);
126  }
127  else
128  {
129  stringbuffer_append_double(sb, pt->x, opts->precision);
130  stringbuffer_append_char(sb, ' ');
131  stringbuffer_append_double(sb, pt->y, opts->precision);
132  }
133  }
134  }
135  else
136  {
137  for (i=0; i<pa->npoints; i++)
138  {
139  const POINT3D *pt = getPoint3d_cp(pa, i);
140  if (i) stringbuffer_append_char(sb, ' ');
141  if (IS_DEGREE(opts->opts))
142  {
143  stringbuffer_append_double(sb, pt->y, opts->precision);
144  stringbuffer_append_char(sb, ' ');
145  stringbuffer_append_double(sb, pt->x, opts->precision);
146  stringbuffer_append_char(sb, ' ');
147  stringbuffer_append_double(sb, pt->z, opts->precision);
148  }
149  else
150  {
151  stringbuffer_append_double(sb, pt->x, opts->precision);
152  stringbuffer_append_char(sb, ' ');
153  stringbuffer_append_double(sb, pt->y, opts->precision);
154  stringbuffer_append_char(sb, ' ');
155  stringbuffer_append_double(sb, pt->z, opts->precision);
156  }
157  }
158  }
159 }
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:165
#define IS_DEGREE(x)
Definition: liblwgeom.h:1692
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(), IS_DEGREE, POINTARRAY::npoints, ovdump::opts, stringbuffer_append_char(), stringbuffer_append_double(), POINT2D::x, POINT3D::x, POINT2D::y, POINT3D::y, and POINT3D::z.

Referenced by asgml3_circstring(), asgml3_compound(), asgml3_curvepoly(), asgml3_gbox(), asgml3_line(), asgml3_point(), asgml3_poly(), and asgml3_triangle().

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