PostGIS  2.4.9dev-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 490 of file lwout_wkt.c.

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWCOLLECTION::geoms, lwgeom_to_wkt_sb(), LWCOLLECTION::ngeoms, stringbuffer_append(), WKT_IS_CHILD, and WKT_NO_TYPE.

Referenced by lwgeom_to_wkt_sb().

491 {
492  int i = 0;
493 
494  if ( ! (variant & WKT_NO_TYPE) )
495  {
496  stringbuffer_append(sb, "GEOMETRYCOLLECTION"); /* "GEOMETRYCOLLECTION" */
497  dimension_qualifiers_to_wkt_sb((LWGEOM*)collection, sb, variant);
498  }
499  if ( collection->ngeoms < 1 )
500  {
501  empty_to_wkt_sb(sb);
502  return;
503  }
504  stringbuffer_append(sb, "(");
505  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are children */
506  for ( i = 0; i < collection->ngeoms; i++ )
507  {
508  if ( i > 0 )
509  stringbuffer_append(sb, ",");
510  lwgeom_to_wkt_sb((LWGEOM*)collection->geoms[i], sb, precision, variant );
511  }
512  stringbuffer_append(sb, ")");
513 }
uint8_t variant
Definition: cu_in_twkb.c:26
static void dimension_qualifiers_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, uint8_t variant)
Definition: lwout_wkt.c:39
LWGEOM ** geoms
Definition: liblwgeom.h:509
#define WKT_IS_CHILD
uint8_t precision
Definition: cu_in_twkb.c:25
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
static void lwgeom_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:600
static void empty_to_wkt_sb(stringbuffer_t *sb)
Definition: lwout_wkt.c:69
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
Definition: stringbuffer.c:134
Here is the call graph for this function:
Here is the caller graph for this function: