PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ gserialized_from_lwgeom_any()

static size_t gserialized_from_lwgeom_any ( const LWGEOM geom,
uint8_t buf 
)
static

Definition at line 1068 of file g_serialized.c.

1069 {
1070  assert(geom);
1071  assert(buf);
1072 
1073  LWDEBUGF(2, "Input type (%d) %s, hasz: %d hasm: %d",
1074  geom->type, lwtype_name(geom->type),
1075  FLAGS_GET_Z(geom->flags), FLAGS_GET_M(geom->flags));
1076  LWDEBUGF(2, "LWGEOM(%p) uint8_t(%p)", geom, buf);
1077 
1078  switch (geom->type)
1079  {
1080  case POINTTYPE:
1081  return gserialized_from_lwpoint((LWPOINT *)geom, buf);
1082  case LINETYPE:
1083  return gserialized_from_lwline((LWLINE *)geom, buf);
1084  case POLYGONTYPE:
1085  return gserialized_from_lwpoly((LWPOLY *)geom, buf);
1086  case TRIANGLETYPE:
1087  return gserialized_from_lwtriangle((LWTRIANGLE *)geom, buf);
1088  case CIRCSTRINGTYPE:
1089  return gserialized_from_lwcircstring((LWCIRCSTRING *)geom, buf);
1090  case CURVEPOLYTYPE:
1091  case COMPOUNDTYPE:
1092  case MULTIPOINTTYPE:
1093  case MULTILINETYPE:
1094  case MULTICURVETYPE:
1095  case MULTIPOLYGONTYPE:
1096  case MULTISURFACETYPE:
1097  case POLYHEDRALSURFACETYPE:
1098  case TINTYPE:
1099  case COLLECTIONTYPE:
1100  return gserialized_from_lwcollection((LWCOLLECTION *)geom, buf);
1101  default:
1102  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
1103  return 0;
1104  }
1105  return 0;
1106 }
static size_t gserialized_from_lwtriangle(const LWTRIANGLE *triangle, uint8_t *buf)
Definition: g_serialized.c:958
static size_t gserialized_from_lwpoly(const LWPOLY *poly, uint8_t *buf)
Definition: g_serialized.c:904
static size_t gserialized_from_lwcollection(const LWCOLLECTION *coll, uint8_t *buf)
static size_t gserialized_from_lwline(const LWLINE *line, uint8_t *buf)
Definition: g_serialized.c:863
static size_t gserialized_from_lwpoint(const LWPOINT *point, uint8_t *buf)
Definition: g_serialized.c:830
static size_t gserialized_from_lwcircstring(const LWCIRCSTRING *curve, uint8_t *buf)
Definition: g_serialized.c:999
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
#define TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
#define MULTICURVETYPE
Definition: liblwgeom.h:95
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#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
uint8_t type
Definition: liblwgeom.h:399
uint8_t flags
Definition: liblwgeom.h:400

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWGEOM::flags, FLAGS_GET_M, FLAGS_GET_Z, gserialized_from_lwcircstring(), gserialized_from_lwcollection(), gserialized_from_lwline(), gserialized_from_lwpoint(), gserialized_from_lwpoly(), gserialized_from_lwtriangle(), LINETYPE, LWDEBUGF, lwerror(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWPOINT::type.

Referenced by gserialized_from_lwcollection(), gserialized_from_lwgeom(), and test_gserialized_peek_gbox_p_fails_for_unsupported_cases().

Here is the call graph for this function:
Here is the caller graph for this function: