PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ gserialized_from_any_size()

static size_t gserialized_from_any_size ( const LWGEOM geom)
static

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

776 {
777  LWDEBUGF(2, "Input type: %s", lwtype_name(geom->type));
778 
779  switch (geom->type)
780  {
781  case POINTTYPE:
782  return gserialized_from_lwpoint_size((LWPOINT *)geom);
783  case LINETYPE:
784  return gserialized_from_lwline_size((LWLINE *)geom);
785  case POLYGONTYPE:
786  return gserialized_from_lwpoly_size((LWPOLY *)geom);
787  case TRIANGLETYPE:
789  case CIRCSTRINGTYPE:
791  case CURVEPOLYTYPE:
792  case COMPOUNDTYPE:
793  case MULTIPOINTTYPE:
794  case MULTILINETYPE:
795  case MULTICURVETYPE:
796  case MULTIPOLYGONTYPE:
797  case MULTISURFACETYPE:
799  case TINTYPE:
800  case COLLECTIONTYPE:
802  default:
803  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
804  return 0;
805  }
806 }
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTICURVETYPE
Definition: liblwgeom.h:95
static size_t gserialized_from_lwcircstring_size(const LWCIRCSTRING *curve)
Definition: g_serialized.c:740
static size_t gserialized_from_lwpoint_size(const LWPOINT *point)
Definition: g_serialized.c:676
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
static size_t gserialized_from_lwline_size(const LWLINE *line)
Definition: g_serialized.c:690
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
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
static size_t gserialized_from_lwcollection_size(const LWCOLLECTION *col)
Definition: g_serialized.c:754
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
static size_t gserialized_from_lwpoly_size(const LWPOLY *poly)
Definition: g_serialized.c:718
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
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
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:704
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: