PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_to_wkt_sb()

static void lwcollection_to_wkt_sb ( const LWCOLLECTION collection,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 496 of file lwout_wkt.c.

497 {
498  uint32_t i = 0;
499 
500  if ( ! (variant & WKT_NO_TYPE) )
501  {
502  stringbuffer_append(sb, "GEOMETRYCOLLECTION"); /* "GEOMETRYCOLLECTION" */
503  dimension_qualifiers_to_wkt_sb((LWGEOM*)collection, sb, variant);
504  }
505  if ( collection->ngeoms < 1 )
506  {
507  empty_to_wkt_sb(sb);
508  return;
509  }
510  stringbuffer_append(sb, "(");
511  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are children */
512  for ( i = 0; i < collection->ngeoms; i++ )
513  {
514  if ( i > 0 )
515  stringbuffer_append(sb, ",");
516  lwgeom_to_wkt_sb((LWGEOM*)collection->geoms[i], sb, precision, variant );
517  }
518  stringbuffer_append(sb, ")");
519 }
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:39
static void empty_to_wkt_sb(stringbuffer_t *sb)
Definition: lwout_wkt.c:69
static void lwgeom_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:606
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
Definition: stringbuffer.c:134
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
unsigned int uint32_t
Definition: uthash.h:78

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWCOLLECTION::geoms, lwgeom_to_wkt_sb(), LWCOLLECTION::ngeoms, precision, stringbuffer_append(), 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: