PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t gserialized_from_any_size ( const LWGEOM geom)
static

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

Referenced by gserialized_from_lwcollection_size(), and gserialized_from_lwgeom_size().

505 {
506  LWDEBUGF(2, "Input type: %s", lwtype_name(geom->type));
507 
508  switch (geom->type)
509  {
510  case POINTTYPE:
511  return gserialized_from_lwpoint_size((LWPOINT *)geom);
512  case LINETYPE:
513  return gserialized_from_lwline_size((LWLINE *)geom);
514  case POLYGONTYPE:
515  return gserialized_from_lwpoly_size((LWPOLY *)geom);
516  case TRIANGLETYPE:
518  case CIRCSTRINGTYPE:
520  case CURVEPOLYTYPE:
521  case COMPOUNDTYPE:
522  case MULTIPOINTTYPE:
523  case MULTILINETYPE:
524  case MULTICURVETYPE:
525  case MULTIPOLYGONTYPE:
526  case MULTISURFACETYPE:
528  case TINTYPE:
529  case COLLECTIONTYPE:
531  default:
532  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
533  return 0;
534  }
535 }
#define LINETYPE
Definition: liblwgeom.h:71
#define MULTICURVETYPE
Definition: liblwgeom.h:80
static size_t gserialized_from_lwcircstring_size(const LWCIRCSTRING *curve)
Definition: g_serialized.c:469
static size_t gserialized_from_lwpoint_size(const LWPOINT *point)
Definition: g_serialized.c:405
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define CURVEPOLYTYPE
Definition: liblwgeom.h:79
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
#define TRIANGLETYPE
Definition: liblwgeom.h:83
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:82
static size_t gserialized_from_lwline_size(const LWLINE *line)
Definition: g_serialized.c:419
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
#define TINTYPE
Definition: liblwgeom.h:84
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
static size_t gserialized_from_lwcollection_size(const LWCOLLECTION *col)
Definition: g_serialized.c:483
#define MULTISURFACETYPE
Definition: liblwgeom.h:81
static size_t gserialized_from_lwpoly_size(const LWPOLY *poly)
Definition: g_serialized.c:447
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
#define MULTILINETYPE
Definition: liblwgeom.h:74
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
static size_t gserialized_from_lwtriangle_size(const LWTRIANGLE *triangle)
Definition: g_serialized.c:433
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: