PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ lwmpoint_to_wkt_sb()

static void lwmpoint_to_wkt_sb ( const LWMPOINT mpoint,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 228 of file lwout_wkt.c.

229 {
230  uint32_t i = 0;
231  if ( ! (variant & WKT_NO_TYPE) )
232  {
233  stringbuffer_append_len(sb, "MULTIPOINT", 10); /* "MULTIPOINT" */
235  }
236  if ( mpoint->ngeoms < 1 )
237  {
238  empty_to_wkt_sb(sb);
239  return;
240  }
241  stringbuffer_append_len(sb, "(", 1);
242  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
243  for ( i = 0; i < mpoint->ngeoms; i++ )
244  {
245  if ( i > 0 )
246  stringbuffer_append_len(sb, ",", 1);
247  /* We don't want type strings or parens on our subgeoms */
249  }
250  stringbuffer_append_len(sb, ")", 1);
251 }
static uint8_t variant
Definition: cu_in_twkb.c:26
static uint8_t precision
Definition: cu_in_twkb.c:25
#define WKT_NO_PARENS
#define WKT_IS_CHILD
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
static void dimension_qualifiers_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, uint8_t variant)
Definition: lwout_wkt.c:40
static void empty_to_wkt_sb(stringbuffer_t *sb)
Definition: lwout_wkt.c:70
static void lwpoint_to_wkt_sb(const LWPOINT *pt, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:142
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:91
uint32_t ngeoms
Definition: liblwgeom.h:552
LWPOINT ** geoms
Definition: liblwgeom.h:547

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWMPOINT::geoms, lwpoint_to_wkt_sb(), LWMPOINT::ngeoms, precision, stringbuffer_append_len(), variant, WKT_IS_CHILD, WKT_NO_PARENS, and WKT_NO_TYPE.

Referenced by lwgeom_to_wkt_sb().

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