PostGIS  2.5.7dev-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 453 of file lwout_wkt.c.

454 {
455  uint32_t i = 0;
456 
457  if ( ! (variant & WKT_NO_TYPE) )
458  {
459  stringbuffer_append(sb, "MULTISURFACE"); /* "MULTISURFACE" */
461  }
462  if ( msurf->ngeoms < 1 )
463  {
464  empty_to_wkt_sb(sb);
465  return;
466  }
467  stringbuffer_append(sb, "(");
468  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
469  for ( i = 0; i < msurf->ngeoms; i++ )
470  {
471  int type = msurf->geoms[i]->type;
472  if ( i > 0 )
473  stringbuffer_append(sb, ",");
474  switch (type)
475  {
476  case POLYGONTYPE:
477  /* Linestring subgeoms don't get type identifiers */
479  break;
480  case CURVEPOLYTYPE:
481  /* But circstring subgeoms *do* get type identifiers */
483  break;
484  default:
485  lwerror("lwmsurface_to_wkt_sb: Unknown type received %d - %s", type, lwtype_name(type));
486  }
487  }
488  stringbuffer_append(sb, ")");
489 }
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:94
#define POLYGONTYPE
Definition: liblwgeom.h:87
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#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:39
static void empty_to_wkt_sb(stringbuffer_t *sb)
Definition: lwout_wkt.c:69
static void lwcurvepoly_to_wkt_sb(const LWCURVEPOLY *cpoly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:357
static void lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:175
type
Definition: ovdump.py:41
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
Definition: stringbuffer.c:134
uint8_t type
Definition: liblwgeom.h:399
uint32_t ngeoms
Definition: liblwgeom.h:562
LWGEOM ** geoms
Definition: liblwgeom.h:564
unsigned int uint32_t
Definition: uthash.h:78

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(), 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: