PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ gserialized2_from_lwgeom_any()

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

Definition at line 1042 of file gserialized2.c.

1043{
1044 assert(geom);
1045 assert(buf);
1046
1047 LWDEBUGF(2, "Input type (%d) %s, hasz: %d hasm: %d",
1048 geom->type, lwtype_name(geom->type),
1049 FLAGS_GET_Z(geom->flags), FLAGS_GET_M(geom->flags));
1050 LWDEBUGF(2, "LWGEOM(%p) uint8_t(%p)", geom, buf);
1051
1052 switch (geom->type)
1053 {
1054 case POINTTYPE:
1055 return gserialized2_from_lwpoint((LWPOINT *)geom, buf);
1056 case LINETYPE:
1057 return gserialized2_from_lwline((LWLINE *)geom, buf);
1058 case POLYGONTYPE:
1059 return gserialized2_from_lwpoly((LWPOLY *)geom, buf);
1060 case TRIANGLETYPE:
1061 return gserialized2_from_lwtriangle((LWTRIANGLE *)geom, buf);
1062 case CIRCSTRINGTYPE:
1063 return gserialized2_from_lwcircstring((LWCIRCSTRING *)geom, buf);
1064 case CURVEPOLYTYPE:
1065 case COMPOUNDTYPE:
1066 case MULTIPOINTTYPE:
1067 case MULTILINETYPE:
1068 case MULTICURVETYPE:
1069 case MULTIPOLYGONTYPE:
1070 case MULTISURFACETYPE:
1072 case TINTYPE:
1073 case COLLECTIONTYPE:
1074 return gserialized2_from_lwcollection((LWCOLLECTION *)geom, buf);
1075 default:
1076 lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
1077 return 0;
1078 }
1079 return 0;
1080}
static size_t gserialized2_from_lwcollection(const LWCOLLECTION *coll, uint8_t *buf)
static size_t gserialized2_from_lwcircstring(const LWCIRCSTRING *curve, uint8_t *buf)
static size_t gserialized2_from_lwpoly(const LWPOLY *poly, uint8_t *buf)
static size_t gserialized2_from_lwtriangle(const LWTRIANGLE *triangle, uint8_t *buf)
static size_t gserialized2_from_lwline(const LWLINE *line, uint8_t *buf)
static size_t gserialized2_from_lwpoint(const LWPOINT *point, uint8_t *buf)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
#define COLLECTIONTYPE
Definition liblwgeom.h:108
#define COMPOUNDTYPE
Definition liblwgeom.h:110
#define CURVEPOLYTYPE
Definition liblwgeom.h:111
#define MULTILINETYPE
Definition liblwgeom.h:106
#define MULTISURFACETYPE
Definition liblwgeom.h:113
#define LINETYPE
Definition liblwgeom.h:103
#define MULTIPOINTTYPE
Definition liblwgeom.h:105
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:102
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
#define TINTYPE
Definition liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
#define POLYGONTYPE
Definition liblwgeom.h:104
#define POLYHEDRALSURFACETYPE
Definition liblwgeom.h:114
#define CIRCSTRINGTYPE
Definition liblwgeom.h:109
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:166
#define MULTICURVETYPE
Definition liblwgeom.h:112
#define TRIANGLETYPE
Definition liblwgeom.h:115
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
uint8_t type
Definition liblwgeom.h:462
lwflags_t flags
Definition liblwgeom.h:461

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: