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

Definition at line 800 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().

801 {
802  assert(geom);
803  assert(buf);
804 
805  LWDEBUGF(2, "Input type (%d) %s, hasz: %d hasm: %d",
806  geom->type, lwtype_name(geom->type),
807  FLAGS_GET_Z(geom->flags), FLAGS_GET_M(geom->flags));
808  LWDEBUGF(2, "LWGEOM(%p) uint8_t(%p)", geom, buf);
809 
810  switch (geom->type)
811  {
812  case POINTTYPE:
813  return gserialized_from_lwpoint((LWPOINT *)geom, buf);
814  case LINETYPE:
815  return gserialized_from_lwline((LWLINE *)geom, buf);
816  case POLYGONTYPE:
817  return gserialized_from_lwpoly((LWPOLY *)geom, buf);
818  case TRIANGLETYPE:
819  return gserialized_from_lwtriangle((LWTRIANGLE *)geom, buf);
820  case CIRCSTRINGTYPE:
821  return gserialized_from_lwcircstring((LWCIRCSTRING *)geom, buf);
822  case CURVEPOLYTYPE:
823  case COMPOUNDTYPE:
824  case MULTIPOINTTYPE:
825  case MULTILINETYPE:
826  case MULTICURVETYPE:
827  case MULTIPOLYGONTYPE:
828  case MULTISURFACETYPE:
830  case TINTYPE:
831  case COLLECTIONTYPE:
832  return gserialized_from_lwcollection((LWCOLLECTION *)geom, buf);
833  default:
834  lwerror("Unknown geometry type: %d - %s", geom->type, lwtype_name(geom->type));
835  return 0;
836  }
837  return 0;
838 }
#define LINETYPE
Definition: liblwgeom.h:61
#define MULTICURVETYPE
Definition: liblwgeom.h:70
static size_t gserialized_from_lwcollection(const LWCOLLECTION *coll, uint8_t *buf)
Definition: g_serialized.c:767
#define POLYGONTYPE
Definition: liblwgeom.h:62
uint8_t flags
Definition: liblwgeom.h:353
#define CURVEPOLYTYPE
Definition: liblwgeom.h:69
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
#define TRIANGLETYPE
Definition: liblwgeom.h:73
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
static size_t gserialized_from_lwtriangle(const LWTRIANGLE *triangle, uint8_t *buf)
Definition: g_serialized.c:690
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
static size_t gserialized_from_lwpoly(const LWPOLY *poly, uint8_t *buf)
Definition: g_serialized.c:637
static size_t gserialized_from_lwpoint(const LWPOINT *point, uint8_t *buf)
Definition: g_serialized.c:563
#define TINTYPE
Definition: liblwgeom.h:74
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define MULTISURFACETYPE
Definition: liblwgeom.h:71
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:107
uint8_t type
Definition: liblwgeom.h:352
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
static size_t gserialized_from_lwcircstring(const LWCIRCSTRING *curve, uint8_t *buf)
Definition: g_serialized.c:731
#define MULTILINETYPE
Definition: liblwgeom.h:64
#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:596
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: