PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gserialized_from_any_size()

static size_t gserialized_from_any_size ( const LWGEOM geom)
static

Definition at line 531 of file g_serialized.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, gserialized_from_lwcircstring_size(), gserialized_from_lwcollection_size(), gserialized_from_lwline_size(), gserialized_from_lwpoint_size(), gserialized_from_lwpoly_size(), gserialized_from_lwtriangle_size(), LINETYPE, LWDEBUGF, lwerror(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWCOLLECTION::type.

Referenced by gserialized_from_lwcollection_size(), gserialized_from_lwgeom_size(), and gserialized_get_gbox_p().

532 {
533  LWDEBUGF(2, "Input type: %s", lwtype_name(geom->type));
534 
535  switch (geom->type)
536  {
537  case POINTTYPE:
538  return gserialized_from_lwpoint_size((LWPOINT *)geom);
539  case LINETYPE:
540  return gserialized_from_lwline_size((LWLINE *)geom);
541  case POLYGONTYPE:
542  return gserialized_from_lwpoly_size((LWPOLY *)geom);
543  case TRIANGLETYPE:
545  case CIRCSTRINGTYPE:
547  case CURVEPOLYTYPE:
548  case COMPOUNDTYPE:
549  case MULTIPOINTTYPE:
550  case MULTILINETYPE:
551  case MULTICURVETYPE:
552  case MULTIPOLYGONTYPE:
553  case MULTISURFACETYPE:
555  case TINTYPE:
556  case COLLECTIONTYPE:
558  default:
559  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
560  return 0;
561  }
562 }
#define LINETYPE
Definition: liblwgeom.h:85
#define MULTICURVETYPE
Definition: liblwgeom.h:94
static size_t gserialized_from_lwcircstring_size(const LWCIRCSTRING *curve)
Definition: g_serialized.c:496
static size_t gserialized_from_lwpoint_size(const LWPOINT *point)
Definition: g_serialized.c:432
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
static size_t gserialized_from_lwline_size(const LWLINE *line)
Definition: g_serialized.c:446
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
#define TINTYPE
Definition: liblwgeom.h:98
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
static size_t gserialized_from_lwcollection_size(const LWCOLLECTION *col)
Definition: g_serialized.c:510
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
static size_t gserialized_from_lwpoly_size(const LWPOLY *poly)
Definition: g_serialized.c:474
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:88
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
static size_t gserialized_from_lwtriangle_size(const LWTRIANGLE *triangle)
Definition: g_serialized.c:460
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: