PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t gserialized_from_lwgeom_any ( const LWGEOM geom,
uint8_t *  buf 
)
static

Definition at line 798 of file g_serialized.c.

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, and LWGEOM::type.

Referenced by gserialized_from_lwcollection(), and gserialized_from_lwgeom().

799 {
800  assert(geom);
801  assert(buf);
802 
803  LWDEBUGF(2, "Input type (%d) %s, hasz: %d hasm: %d",
804  geom->type, lwtype_name(geom->type),
805  FLAGS_GET_Z(geom->flags), FLAGS_GET_M(geom->flags));
806  LWDEBUGF(2, "LWGEOM(%p) uint8_t(%p)", geom, buf);
807 
808  switch (geom->type)
809  {
810  case POINTTYPE:
811  return gserialized_from_lwpoint((LWPOINT *)geom, buf);
812  case LINETYPE:
813  return gserialized_from_lwline((LWLINE *)geom, buf);
814  case POLYGONTYPE:
815  return gserialized_from_lwpoly((LWPOLY *)geom, buf);
816  case TRIANGLETYPE:
817  return gserialized_from_lwtriangle((LWTRIANGLE *)geom, buf);
818  case CIRCSTRINGTYPE:
819  return gserialized_from_lwcircstring((LWCIRCSTRING *)geom, buf);
820  case CURVEPOLYTYPE:
821  case COMPOUNDTYPE:
822  case MULTIPOINTTYPE:
823  case MULTILINETYPE:
824  case MULTICURVETYPE:
825  case MULTIPOLYGONTYPE:
826  case MULTISURFACETYPE:
828  case TINTYPE:
829  case COLLECTIONTYPE:
830  return gserialized_from_lwcollection((LWCOLLECTION *)geom, buf);
831  default:
832  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
833  return 0;
834  }
835  return 0;
836 }
#define LINETYPE
Definition: liblwgeom.h:71
#define MULTICURVETYPE
Definition: liblwgeom.h:80
static size_t gserialized_from_lwcollection(const LWCOLLECTION *coll, uint8_t *buf)
Definition: g_serialized.c:765
#define POLYGONTYPE
Definition: liblwgeom.h:72
uint8_t flags
Definition: liblwgeom.h:381
#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_lwtriangle(const LWTRIANGLE *triangle, uint8_t *buf)
Definition: g_serialized.c:688
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
static size_t gserialized_from_lwpoly(const LWPOLY *poly, uint8_t *buf)
Definition: g_serialized.c:635
static size_t gserialized_from_lwpoint(const LWPOINT *point, uint8_t *buf)
Definition: g_serialized.c:561
#define TINTYPE
Definition: liblwgeom.h:84
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
#define MULTISURFACETYPE
Definition: liblwgeom.h:81
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
static size_t gserialized_from_lwcircstring(const LWCIRCSTRING *curve, uint8_t *buf)
Definition: g_serialized.c:729
#define MULTILINETYPE
Definition: liblwgeom.h:74
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
static size_t gserialized_from_lwline(const LWLINE *line, uint8_t *buf)
Definition: g_serialized.c:594
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: