PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_to_wkt_sb()

static void lwgeom_to_wkt_sb ( const LWGEOM geom,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 600 of file lwout_wkt.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWGEOM::flags, FLAGS_GET_M, FLAGS_GET_Z, LINETYPE, lwcircstring_to_wkt_sb(), lwcollection_to_wkt_sb(), lwcompound_to_wkt_sb(), lwcurvepoly_to_wkt_sb(), LWDEBUGF, lwerror(), lwline_to_wkt_sb(), lwmcurve_to_wkt_sb(), lwmline_to_wkt_sb(), lwmpoint_to_wkt_sb(), lwmpoly_to_wkt_sb(), lwmsurface_to_wkt_sb(), lwpoint_to_wkt_sb(), lwpoly_to_wkt_sb(), lwpsurface_to_wkt_sb(), lwtin_to_wkt_sb(), lwtriangle_to_wkt_sb(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWPSURFACE::type.

Referenced by lwcollection_to_wkt_sb(), and lwgeom_to_wkt().

601 {
602  LWDEBUGF(4, "lwgeom_to_wkt_sb: type %s, hasz %d, hasm %d",
603  lwtype_name(geom->type), (geom->type),
604  FLAGS_GET_Z(geom->flags)?1:0, FLAGS_GET_M(geom->flags)?1:0);
605 
606  switch (geom->type)
607  {
608  case POINTTYPE:
610  break;
611  case LINETYPE:
613  break;
614  case POLYGONTYPE:
616  break;
617  case MULTIPOINTTYPE:
619  break;
620  case MULTILINETYPE:
622  break;
623  case MULTIPOLYGONTYPE:
625  break;
626  case COLLECTIONTYPE:
628  break;
629  case CIRCSTRINGTYPE:
631  break;
632  case COMPOUNDTYPE:
634  break;
635  case CURVEPOLYTYPE:
637  break;
638  case MULTICURVETYPE:
640  break;
641  case MULTISURFACETYPE:
643  break;
644  case TRIANGLETYPE:
646  break;
647  case TINTYPE:
648  lwtin_to_wkt_sb((LWTIN*)geom, sb, precision, variant);
649  break;
652  break;
653  default:
654  lwerror("lwgeom_to_wkt_sb: Type %d - %s unsupported.",
655  geom->type, lwtype_name(geom->type));
656  }
657 }
#define LINETYPE
Definition: liblwgeom.h:86
static void lwtin_to_wkt_sb(const LWTIN *tin, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:539
static void lwmcurve_to_wkt_sb(const LWMCURVE *mcurv, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:399
#define MULTICURVETYPE
Definition: liblwgeom.h:95
uint8_t variant
Definition: cu_in_twkb.c:26
#define POLYGONTYPE
Definition: liblwgeom.h:87
static void lwpsurface_to_wkt_sb(const LWPSURFACE *psurf, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:568
uint8_t flags
Definition: liblwgeom.h:397
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
static void lwcurvepoly_to_wkt_sb(const LWCURVEPOLY *cpoly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:351
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
static void lwcircstring_to_wkt_sb(const LWCIRCSTRING *circ, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:196
static void lwtriangle_to_wkt_sb(const LWTRIANGLE *tri, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:518
static void lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:169
static void lwmline_to_wkt_sb(const LWMLINE *mline, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:244
static void lwmpoint_to_wkt_sb(const LWMPOINT *mpoint, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:216
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define TINTYPE
Definition: liblwgeom.h:99
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
static void lwmpoly_to_wkt_sb(const LWMPOLY *mpoly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:274
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
static void lwcompound_to_wkt_sb(const LWCOMPOUND *comp, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:306
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
static void lwpoint_to_wkt_sb(const LWPOINT *pt, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:130
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
static void lwcollection_to_wkt_sb(const LWCOLLECTION *collection, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:490
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
uint8_t type
Definition: liblwgeom.h:396
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
static void lwmsurface_to_wkt_sb(const LWMSURFACE *msurf, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:447
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
static void lwline_to_wkt_sb(const LWLINE *line, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:150
Here is the call graph for this function:
Here is the caller graph for this function: