PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void lwgeom_to_wkt_sb ( const LWGEOM geom,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 586 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, and LWGEOM::type.

Referenced by lwcollection_to_wkt_sb(), and lwgeom_to_wkt().

587 {
588  LWDEBUGF(4, "lwgeom_to_wkt_sb: type %s, hasz %d, hasm %d",
589  lwtype_name(geom->type), (geom->type),
590  FLAGS_GET_Z(geom->flags)?1:0, FLAGS_GET_M(geom->flags)?1:0);
591 
592  switch (geom->type)
593  {
594  case POINTTYPE:
595  lwpoint_to_wkt_sb((LWPOINT*)geom, sb, precision, variant);
596  break;
597  case LINETYPE:
598  lwline_to_wkt_sb((LWLINE*)geom, sb, precision, variant);
599  break;
600  case POLYGONTYPE:
601  lwpoly_to_wkt_sb((LWPOLY*)geom, sb, precision, variant);
602  break;
603  case MULTIPOINTTYPE:
604  lwmpoint_to_wkt_sb((LWMPOINT*)geom, sb, precision, variant);
605  break;
606  case MULTILINETYPE:
607  lwmline_to_wkt_sb((LWMLINE*)geom, sb, precision, variant);
608  break;
609  case MULTIPOLYGONTYPE:
610  lwmpoly_to_wkt_sb((LWMPOLY*)geom, sb, precision, variant);
611  break;
612  case COLLECTIONTYPE:
613  lwcollection_to_wkt_sb((LWCOLLECTION*)geom, sb, precision, variant);
614  break;
615  case CIRCSTRINGTYPE:
616  lwcircstring_to_wkt_sb((LWCIRCSTRING*)geom, sb, precision, variant);
617  break;
618  case COMPOUNDTYPE:
619  lwcompound_to_wkt_sb((LWCOMPOUND*)geom, sb, precision, variant);
620  break;
621  case CURVEPOLYTYPE:
622  lwcurvepoly_to_wkt_sb((LWCURVEPOLY*)geom, sb, precision, variant);
623  break;
624  case MULTICURVETYPE:
625  lwmcurve_to_wkt_sb((LWMCURVE*)geom, sb, precision, variant);
626  break;
627  case MULTISURFACETYPE:
628  lwmsurface_to_wkt_sb((LWMSURFACE*)geom, sb, precision, variant);
629  break;
630  case TRIANGLETYPE:
631  lwtriangle_to_wkt_sb((LWTRIANGLE*)geom, sb, precision, variant);
632  break;
633  case TINTYPE:
634  lwtin_to_wkt_sb((LWTIN*)geom, sb, precision, variant);
635  break;
637  lwpsurface_to_wkt_sb((LWPSURFACE*)geom, sb, precision, variant);
638  break;
639  default:
640  lwerror("lwgeom_to_wkt_sb: Type %d - %s unsupported.",
641  geom->type, lwtype_name(geom->type));
642  }
643 }
#define LINETYPE
Definition: liblwgeom.h:61
static void lwtin_to_wkt_sb(const LWTIN *tin, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:525
static void lwmcurve_to_wkt_sb(const LWMCURVE *mcurv, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:385
#define MULTICURVETYPE
Definition: liblwgeom.h:70
#define POLYGONTYPE
Definition: liblwgeom.h:62
static void lwpsurface_to_wkt_sb(const LWPSURFACE *psurf, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:554
uint8_t flags
Definition: liblwgeom.h:353
#define CURVEPOLYTYPE
Definition: liblwgeom.h:69
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
static void lwcurvepoly_to_wkt_sb(const LWCURVEPOLY *cpoly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:337
#define TRIANGLETYPE
Definition: liblwgeom.h:73
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
static void lwcircstring_to_wkt_sb(const LWCIRCSTRING *circ, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:182
static void lwtriangle_to_wkt_sb(const LWTRIANGLE *tri, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:504
static void lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:155
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
static void lwmline_to_wkt_sb(const LWMLINE *mline, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:230
static void lwmpoint_to_wkt_sb(const LWMPOINT *mpoint, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:202
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
#define TINTYPE
Definition: liblwgeom.h:74
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
static void lwmpoly_to_wkt_sb(const LWMPOLY *mpoly, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:260
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
static void lwcompound_to_wkt_sb(const LWCOMPOUND *comp, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:292
#define MULTISURFACETYPE
Definition: liblwgeom.h:71
static void lwpoint_to_wkt_sb(const LWPOINT *pt, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:116
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
static void lwcollection_to_wkt_sb(const LWCOLLECTION *collection, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:476
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:107
uint8_t type
Definition: liblwgeom.h:352
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
static void lwmsurface_to_wkt_sb(const LWMSURFACE *msurf, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:433
#define COLLECTIONTYPE
Definition: liblwgeom.h:66
static void lwline_to_wkt_sb(const LWLINE *line, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:136

Here is the call graph for this function:

Here is the caller graph for this function: