PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwmpoly_to_wkt_sb()

static void lwmpoly_to_wkt_sb ( const LWMPOLY mpoly,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 290 of file lwout_wkt.c.

291 {
292  uint32_t i = 0;
293 
294  if ( ! (variant & WKT_NO_TYPE) )
295  {
296  stringbuffer_append_len(sb, "MULTIPOLYGON", 12); /* "MULTIPOLYGON" */
298  }
299  if ( mpoly->ngeoms < 1 )
300  {
301  empty_to_wkt_sb(sb);
302  return;
303  }
304 
305  stringbuffer_append_len(sb, "(", 1);
306  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
307  for ( i = 0; i < mpoly->ngeoms; i++ )
308  {
309  if ( i > 0 )
310  stringbuffer_append_len(sb, ",", 1);
311  /* We don't want type strings on our subgeoms */
312  lwpoly_to_wkt_sb(mpoly->geoms[i], sb, precision, variant | WKT_NO_TYPE );
313  }
314  stringbuffer_append_len(sb, ")", 1);
315 }
static uint8_t variant
Definition: cu_in_twkb.c:26
static uint8_t precision
Definition: cu_in_twkb.c:25
#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 lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:181
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:566
LWPOLY ** geoms
Definition: liblwgeom.h:561

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWMPOLY::geoms, lwpoly_to_wkt_sb(), LWMPOLY::ngeoms, precision, stringbuffer_append_len(), variant, WKT_IS_CHILD, 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: