PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ ptarray_to_kml2_sb()

static int ptarray_to_kml2_sb ( const POINTARRAY pa,
int  precision,
stringbuffer_t sb 
)
static

Definition at line 98 of file lwout_kml.c.

99 {
100  uint32_t i, j;
101  uint32_t dims = FLAGS_GET_Z(pa->flags) ? 3 : 2;
102  POINT4D pt;
103  double *d;
104 
105  for ( i = 0; i < pa->npoints; i++ )
106  {
107  getPoint4d_p(pa, i, &pt);
108  d = (double*)(&pt);
109  if ( i ) stringbuffer_append_len(sb," ",1);
110  for (j = 0; j < dims; j++)
111  {
112  if ( j ) stringbuffer_append_len(sb,",",1);
114  }
115  }
116  return LW_SUCCESS;
117 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LW_SUCCESS
Definition: liblwgeom.h:97
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:165
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:125
static void stringbuffer_append_double(stringbuffer_t *s, double d, int precision)
Definition: stringbuffer.h:112
static void stringbuffer_append_len(stringbuffer_t *s, const char *a, size_t alen)
Append the specified string to the stringbuffer_t using known length.
Definition: stringbuffer.h:93
lwflags_t flags
Definition: liblwgeom.h:431
uint32_t npoints
Definition: liblwgeom.h:427

References POINTARRAY::flags, FLAGS_GET_Z, getPoint4d_p(), LW_SUCCESS, POINTARRAY::npoints, precision, stringbuffer_append_double(), and stringbuffer_append_len().

Referenced by lwline_to_kml2_sb(), lwpoint_to_kml2_sb(), lwpoly_to_kml2_sb(), and lwtriangle_to_kml2_sb().

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