PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ gserialized2_from_lwgeom_any()

static size_t gserialized2_from_lwgeom_any ( const LWGEOM geom,
uint8_t *  buf 
)
static

Definition at line 1039 of file gserialized2.c.

1040 {
1041  assert(geom);
1042  assert(buf);
1043 
1044  LWDEBUGF(2, "Input type (%d) %s, hasz: %d hasm: %d",
1045  geom->type, lwtype_name(geom->type),
1046  FLAGS_GET_Z(geom->flags), FLAGS_GET_M(geom->flags));
1047  LWDEBUGF(2, "LWGEOM(%p) uint8_t(%p)", geom, buf);
1048 
1049  switch (geom->type)
1050  {
1051  case POINTTYPE:
1052  return gserialized2_from_lwpoint((LWPOINT *)geom, buf);
1053  case LINETYPE:
1054  return gserialized2_from_lwline((LWLINE *)geom, buf);
1055  case POLYGONTYPE:
1056  return gserialized2_from_lwpoly((LWPOLY *)geom, buf);
1057  case TRIANGLETYPE:
1058  return gserialized2_from_lwtriangle((LWTRIANGLE *)geom, buf);
1059  case CIRCSTRINGTYPE:
1060  return gserialized2_from_lwcircstring((LWCIRCSTRING *)geom, buf);
1061  case CURVEPOLYTYPE:
1062  case COMPOUNDTYPE:
1063  case MULTIPOINTTYPE:
1064  case MULTILINETYPE:
1065  case MULTICURVETYPE:
1066  case MULTIPOLYGONTYPE:
1067  case MULTISURFACETYPE:
1068  case POLYHEDRALSURFACETYPE:
1069  case TINTYPE:
1070  case COLLECTIONTYPE:
1071  return gserialized2_from_lwcollection((LWCOLLECTION *)geom, buf);
1072  default:
1073  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
1074  return 0;
1075  }
1076  return 0;
1077 }
static size_t gserialized2_from_lwcollection(const LWCOLLECTION *coll, uint8_t *buf)
static size_t gserialized2_from_lwcircstring(const LWCIRCSTRING *curve, uint8_t *buf)
Definition: gserialized2.c:970
static size_t gserialized2_from_lwpoly(const LWPOLY *poly, uint8_t *buf)
Definition: gserialized2.c:875
static size_t gserialized2_from_lwtriangle(const LWTRIANGLE *triangle, uint8_t *buf)
Definition: gserialized2.c:929
static size_t gserialized2_from_lwline(const LWLINE *line, uint8_t *buf)
Definition: gserialized2.c:834
static size_t gserialized2_from_lwpoint(const LWPOINT *point, uint8_t *buf)
Definition: gserialized2.c:801
#define COLLECTIONTYPE
Definition: liblwgeom.h:122
#define COMPOUNDTYPE
Definition: liblwgeom.h:124
#define CURVEPOLYTYPE
Definition: liblwgeom.h:125
#define MULTILINETYPE
Definition: liblwgeom.h:120
#define MULTISURFACETYPE
Definition: liblwgeom.h:127
#define LINETYPE
Definition: liblwgeom.h:117
#define MULTIPOINTTYPE
Definition: liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:116
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:179
#define TINTYPE
Definition: liblwgeom.h:130
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:121
#define POLYGONTYPE
Definition: liblwgeom.h:118
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:128
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:123
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:180
#define MULTICURVETYPE
Definition: liblwgeom.h:126
#define TRIANGLETYPE
Definition: liblwgeom.h:129
#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:448
lwflags_t flags
Definition: liblwgeom.h:447

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWGEOM::flags, FLAGS_GET_M, FLAGS_GET_Z, gserialized2_from_lwcircstring(), gserialized2_from_lwcollection(), gserialized2_from_lwline(), gserialized2_from_lwpoint(), gserialized2_from_lwpoly(), gserialized2_from_lwtriangle(), LINETYPE, LWDEBUGF, lwerror(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, LWGEOM::type, and LWPOINT::type.

Referenced by gserialized2_from_lwcollection(), gserialized2_from_lwgeom(), and test_gserialized2_peek_gbox_p_fails_for_unsupported_cases().

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