PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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);
125 stringbuffer_append_double(sb, pt->x, opts->precision);
126 }
127 else
128 {
129 stringbuffer_append_double(sb, pt->x, opts->precision);
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);
145 stringbuffer_append_double(sb, pt->x, opts->precision);
147 stringbuffer_append_double(sb, pt->z, opts->precision);
148 }
149 else
150 {
151 stringbuffer_append_double(sb, pt->x, opts->precision);
153 stringbuffer_append_double(sb, pt->y, opts->precision);
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:1722
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:109
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:97
static void stringbuffer_append_double(stringbuffer_t *s, double d, int precision)
static void stringbuffer_append_char(stringbuffer_t *s, char c)
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, 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: