PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwtin_to_wkt_sb()

static void lwtin_to_wkt_sb ( const LWTIN tin,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 539 of file lwout_wkt.c.

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWTIN::geoms, lwtriangle_to_wkt_sb(), LWTIN::ngeoms, stringbuffer_append(), and WKT_NO_TYPE.

Referenced by lwgeom_to_wkt_sb().

540 {
541  int i = 0;
542 
543  if ( ! (variant & WKT_NO_TYPE) )
544  {
545  stringbuffer_append(sb, "TIN"); /* "TIN" */
547  }
548  if ( tin->ngeoms < 1 )
549  {
550  empty_to_wkt_sb(sb);
551  return;
552  }
553 
554  stringbuffer_append(sb, "(");
555  for ( i = 0; i < tin->ngeoms; i++ )
556  {
557  if ( i > 0 )
558  stringbuffer_append(sb, ",");
559  /* We don't want type strings on our subgeoms */
560  lwtriangle_to_wkt_sb(tin->geoms[i], sb, precision, variant | WKT_NO_TYPE );
561  }
562  stringbuffer_append(sb, ")");
563 }
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
static void lwtriangle_to_wkt_sb(const LWTRIANGLE *tri, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:518
int ngeoms
Definition: liblwgeom.h:585
LWTRIANGLE ** geoms
Definition: liblwgeom.h:587
uint8_t precision
Definition: cu_in_twkb.c:25
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
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: