PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ lwmsurface_to_wkt_sb()

static void lwmsurface_to_wkt_sb ( const LWMSURFACE msurf,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 459 of file lwout_wkt.c.

460 {
461  uint32_t i = 0;
462 
463  if ( ! (variant & WKT_NO_TYPE) )
464  {
465  stringbuffer_append_len(sb, "MULTISURFACE", 12); /* "MULTISURFACE" */
467  }
468  if ( msurf->ngeoms < 1 )
469  {
470  empty_to_wkt_sb(sb);
471  return;
472  }
473  stringbuffer_append_len(sb, "(", 1);
474  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
475  for ( i = 0; i < msurf->ngeoms; i++ )
476  {
477  int type = msurf->geoms[i]->type;
478  if ( i > 0 )
479  stringbuffer_append_len(sb, ",", 1);
480  switch (type)
481  {
482  case POLYGONTYPE:
483  /* Linestring subgeoms don't get type identifiers */
485  break;
486  case CURVEPOLYTYPE:
487  /* But circstring subgeoms *do* get type identifiers */
489  break;
490  default:
491  lwerror("lwmsurface_to_wkt_sb: Unknown type received %d - %s", type, lwtype_name(type));
492  }
493  }
494  stringbuffer_append_len(sb, ")", 1);
495 }
static uint8_t variant
Definition: cu_in_twkb.c:26
static uint8_t precision
Definition: cu_in_twkb.c:25
#define CURVEPOLYTYPE
Definition: liblwgeom.h:125
#define POLYGONTYPE
Definition: liblwgeom.h:118
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
#define WKT_IS_CHILD
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
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 lwcurvepoly_to_wkt_sb(const LWCURVEPOLY *cpoly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:363
static void lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:181
type
Definition: ovdump.py:42
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:91
uint8_t type
Definition: liblwgeom.h:476
uint32_t ngeoms
Definition: liblwgeom.h:650
LWGEOM ** geoms
Definition: liblwgeom.h:645

References CURVEPOLYTYPE, dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWMSURFACE::geoms, lwcurvepoly_to_wkt_sb(), lwerror(), lwpoly_to_wkt_sb(), lwtype_name(), LWMSURFACE::ngeoms, POLYGONTYPE, precision, stringbuffer_append_len(), LWGEOM::type, ovdump::type, 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: