PostGIS  3.4.0dev-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 230 of file lwout_wkt.c.

231 {
232  uint32_t i = 0;
233  if ( ! (variant & WKT_NO_TYPE) )
234  {
235  stringbuffer_append_len(sb, "MULTIPOINT", 10); /* "MULTIPOINT" */
237  }
238  if ( mpoint->ngeoms < 1 )
239  {
240  empty_to_wkt_sb(sb);
241  return;
242  }
243  stringbuffer_append_len(sb, "(", 1);
244  variant = variant | WKT_IS_CHILD | WKT_NO_TYPE; /* Inform the sub-geometries they are children */
245  if ( !(variant & WKT_ISO) )
247  for ( i = 0; i < mpoint->ngeoms; i++ )
248  {
249  if ( i > 0 )
250  stringbuffer_append_len(sb, ",", 1);
251  /* We don't want type strings or parens on our subgeoms */
252  lwpoint_to_wkt_sb(mpoint->geoms[i], sb, precision, variant);
253  }
254  stringbuffer_append_len(sb, ")", 1);
255 }
static uint8_t variant
Definition: cu_in_twkb.c:26
static uint8_t precision
Definition: cu_in_twkb.c:25
#define WKT_ISO
Definition: liblwgeom.h:2184
#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:93
uint32_t ngeoms
Definition: liblwgeom.h:538
LWPOINT ** geoms
Definition: liblwgeom.h:533

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_ISO, 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: