PostGIS  2.3.8dev-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 274 of file lwout_wkt.c.

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWMPOLY::geoms, lwpoly_to_wkt_sb(), LWMPOLY::ngeoms, stringbuffer_append(), WKT_IS_CHILD, and WKT_NO_TYPE.

Referenced by lwgeom_to_wkt_sb().

275 {
276  int i = 0;
277 
278  if ( ! (variant & WKT_NO_TYPE) )
279  {
280  stringbuffer_append(sb, "MULTIPOLYGON"); /* "MULTIPOLYGON" */
282  }
283  if ( mpoly->ngeoms < 1 )
284  {
285  empty_to_wkt_sb(sb);
286  return;
287  }
288 
289  stringbuffer_append(sb, "(");
290  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
291  for ( i = 0; i < mpoly->ngeoms; i++ )
292  {
293  if ( i > 0 )
294  stringbuffer_append(sb, ",");
295  /* We don't want type strings on our subgeoms */
296  lwpoly_to_wkt_sb(mpoly->geoms[i], sb, precision, variant | WKT_NO_TYPE );
297  }
298  stringbuffer_append(sb, ")");
299 }
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 lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:169
LWPOLY ** geoms
Definition: liblwgeom.h:495
#define WKT_IS_CHILD
uint8_t precision
Definition: cu_in_twkb.c:25
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
int ngeoms
Definition: liblwgeom.h:493
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: