PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWGEOM * lwgeom_from_gserialized_buffer ( uint8_t *  data_ptr,
uint8_t  g_flags,
size_t *  g_size 
)
static

Definition at line 1237 of file g_serialized.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, FLAGS_GET_BBOX, FLAGS_GET_GEODETIC, FLAGS_GET_M, FLAGS_GET_Z, LINETYPE, lw_get_uint32_t(), lwcircstring_from_gserialized_buffer(), lwcollection_from_gserialized_buffer(), LWDEBUGF, lwerror(), lwline_from_gserialized_buffer(), lwpoint_from_gserialized_buffer(), lwpoly_from_gserialized_buffer(), lwtriangle_from_gserialized_buffer(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, and TRIANGLETYPE.

Referenced by lwcollection_from_gserialized_buffer(), and lwgeom_from_gserialized().

1238 {
1239  uint32_t type;
1240 
1241  assert(data_ptr);
1242 
1243  type = lw_get_uint32_t(data_ptr);
1244 
1245  LWDEBUGF(2, "Got type %d (%s), hasz=%d hasm=%d geodetic=%d hasbox=%d", type, lwtype_name(type),
1246  FLAGS_GET_Z(g_flags), FLAGS_GET_M(g_flags), FLAGS_GET_GEODETIC(g_flags), FLAGS_GET_BBOX(g_flags));
1247 
1248  switch (type)
1249  {
1250  case POINTTYPE:
1251  return (LWGEOM *)lwpoint_from_gserialized_buffer(data_ptr, g_flags, g_size);
1252  case LINETYPE:
1253  return (LWGEOM *)lwline_from_gserialized_buffer(data_ptr, g_flags, g_size);
1254  case CIRCSTRINGTYPE:
1255  return (LWGEOM *)lwcircstring_from_gserialized_buffer(data_ptr, g_flags, g_size);
1256  case POLYGONTYPE:
1257  return (LWGEOM *)lwpoly_from_gserialized_buffer(data_ptr, g_flags, g_size);
1258  case TRIANGLETYPE:
1259  return (LWGEOM *)lwtriangle_from_gserialized_buffer(data_ptr, g_flags, g_size);
1260  case MULTIPOINTTYPE:
1261  case MULTILINETYPE:
1262  case MULTIPOLYGONTYPE:
1263  case COMPOUNDTYPE:
1264  case CURVEPOLYTYPE:
1265  case MULTICURVETYPE:
1266  case MULTISURFACETYPE:
1267  case POLYHEDRALSURFACETYPE:
1268  case TINTYPE:
1269  case COLLECTIONTYPE:
1270  return (LWGEOM *)lwcollection_from_gserialized_buffer(data_ptr, g_flags, g_size);
1271  default:
1272  lwerror("Unknown geometry type: %d - %s", type, lwtype_name(type));
1273  return NULL;
1274  }
1275 }
#define LINETYPE
Definition: liblwgeom.h:85
static LWLINE * lwline_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWTRIANGLE * lwtriangle_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWCIRCSTRING * lwcircstring_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
#define MULTICURVETYPE
Definition: liblwgeom.h:94
static LWCOLLECTION * lwcollection_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
static LWPOLY * lwpoly_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
#define FLAGS_GET_GEODETIC(flags)
Definition: liblwgeom.h:142
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
uint32_t lw_get_uint32_t(const uint8_t *loc)
Definition: lwgeom_api.c:582
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_BBOX(flags)
Definition: liblwgeom.h:141
#define TINTYPE
Definition: liblwgeom.h:98
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
tuple g_size
Definition: genraster.py:41
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:88
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
static LWPOINT * lwpoint_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
#define COLLECTIONTYPE
Definition: liblwgeom.h:90

Here is the call graph for this function:

Here is the caller graph for this function: