PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ gserialized_from_any_size()

static size_t gserialized_from_any_size ( const LWGEOM geom)
static

Definition at line 772 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().

773 {
774  LWDEBUGF(2, "Input type: %s", lwtype_name(geom->type));
775 
776  switch (geom->type)
777  {
778  case POINTTYPE:
779  return gserialized_from_lwpoint_size((LWPOINT *)geom);
780  case LINETYPE:
781  return gserialized_from_lwline_size((LWLINE *)geom);
782  case POLYGONTYPE:
783  return gserialized_from_lwpoly_size((LWPOLY *)geom);
784  case TRIANGLETYPE:
786  case CIRCSTRINGTYPE:
788  case CURVEPOLYTYPE:
789  case COMPOUNDTYPE:
790  case MULTIPOINTTYPE:
791  case MULTILINETYPE:
792  case MULTICURVETYPE:
793  case MULTIPOLYGONTYPE:
794  case MULTISURFACETYPE:
796  case TINTYPE:
797  case COLLECTIONTYPE:
799  default:
800  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
801  return 0;
802  }
803 }
#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:737
static size_t gserialized_from_lwpoint_size(const LWPOINT *point)
Definition: g_serialized.c:673
#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:687
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:98
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
static size_t gserialized_from_lwcollection_size(const LWCOLLECTION *col)
Definition: g_serialized.c:751
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
static size_t gserialized_from_lwpoly_size(const LWPOLY *poly)
Definition: g_serialized.c:715
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:398
#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:190
static size_t gserialized_from_lwtriangle_size(const LWTRIANGLE *triangle)
Definition: g_serialized.c:701
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
Here is the call graph for this function:
Here is the caller graph for this function: