PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcurvepoly_to_wkt_sb()

static void lwcurvepoly_to_wkt_sb ( const LWCURVEPOLY cpoly,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 357 of file lwout_wkt.c.

358 {
359  uint32_t i = 0;
360 
361  if ( ! (variant & WKT_NO_TYPE) )
362  {
363  stringbuffer_append(sb, "CURVEPOLYGON"); /* "CURVEPOLYGON" */
365  }
366  if ( cpoly->nrings < 1 )
367  {
368  empty_to_wkt_sb(sb);
369  return;
370  }
371  stringbuffer_append(sb, "(");
372  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
373  for ( i = 0; i < cpoly->nrings; i++ )
374  {
375  int type = cpoly->rings[i]->type;
376  if ( i > 0 )
377  stringbuffer_append(sb, ",");
378  switch (type)
379  {
380  case LINETYPE:
381  /* Linestring subgeoms don't get type identifiers */
383  break;
384  case CIRCSTRINGTYPE:
385  /* But circstring subgeoms *do* get type identifiers */
387  break;
388  case COMPOUNDTYPE:
389  /* And compoundcurve subgeoms *do* get type identifiers */
391  break;
392  default:
393  lwerror("lwcurvepoly_to_wkt_sb: Unknown type received %d - %s", type, lwtype_name(type));
394  }
395  }
396  stringbuffer_append(sb, ")");
397 }
static uint8_t variant
Definition: cu_in_twkb.c:26
static uint8_t precision
Definition: cu_in_twkb.c:25
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define LINETYPE
Definition: liblwgeom.h:86
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
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 lwcircstring_to_wkt_sb(const LWCIRCSTRING *circ, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:202
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 lwcompound_to_wkt_sb(const LWCOMPOUND *comp, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:312
static void lwline_to_wkt_sb(const LWLINE *line, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:156
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
LWGEOM ** rings
Definition: liblwgeom.h:538
uint32_t nrings
Definition: liblwgeom.h:536
uint8_t type
Definition: liblwgeom.h:399
unsigned int uint32_t
Definition: uthash.h:78

References CIRCSTRINGTYPE, COMPOUNDTYPE, dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LINETYPE, lwcircstring_to_wkt_sb(), lwcompound_to_wkt_sb(), lwerror(), lwline_to_wkt_sb(), lwtype_name(), LWCURVEPOLY::nrings, precision, LWCURVEPOLY::rings, stringbuffer_append(), LWGEOM::type, ovdump::type, variant, WKT_IS_CHILD, and WKT_NO_TYPE.

Referenced by lwgeom_to_wkt_sb(), and lwmsurface_to_wkt_sb().

Here is the call graph for this function:
Here is the caller graph for this function: