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

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

1213 {
1214  uint32_t type;
1215 
1216  assert(data_ptr);
1217 
1218  type = lw_get_uint32_t(data_ptr);
1219 
1220  LWDEBUGF(2, "Got type %d (%s), hasz=%d hasm=%d geodetic=%d hasbox=%d", type, lwtype_name(type),
1221  FLAGS_GET_Z(g_flags), FLAGS_GET_M(g_flags), FLAGS_GET_GEODETIC(g_flags), FLAGS_GET_BBOX(g_flags));
1222 
1223  switch (type)
1224  {
1225  case POINTTYPE:
1226  return (LWGEOM *)lwpoint_from_gserialized_buffer(data_ptr, g_flags, g_size);
1227  case LINETYPE:
1228  return (LWGEOM *)lwline_from_gserialized_buffer(data_ptr, g_flags, g_size);
1229  case CIRCSTRINGTYPE:
1230  return (LWGEOM *)lwcircstring_from_gserialized_buffer(data_ptr, g_flags, g_size);
1231  case POLYGONTYPE:
1232  return (LWGEOM *)lwpoly_from_gserialized_buffer(data_ptr, g_flags, g_size);
1233  case TRIANGLETYPE:
1234  return (LWGEOM *)lwtriangle_from_gserialized_buffer(data_ptr, g_flags, g_size);
1235  case MULTIPOINTTYPE:
1236  case MULTILINETYPE:
1237  case MULTIPOLYGONTYPE:
1238  case COMPOUNDTYPE:
1239  case CURVEPOLYTYPE:
1240  case MULTICURVETYPE:
1241  case MULTISURFACETYPE:
1242  case POLYHEDRALSURFACETYPE:
1243  case TINTYPE:
1244  case COLLECTIONTYPE:
1245  return (LWGEOM *)lwcollection_from_gserialized_buffer(data_ptr, g_flags, g_size);
1246  default:
1247  lwerror("Unknown geometry type: %d - %s", type, lwtype_name(type));
1248  return NULL;
1249  }
1250 }
#define LINETYPE
Definition: liblwgeom.h:61
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:70
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:109
#define POLYGONTYPE
Definition: liblwgeom.h:62
#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
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
uint32_t lw_get_uint32_t(const uint8_t *loc)
Definition: lwgeom_api.c:534
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
#define FLAGS_GET_BBOX(flags)
Definition: liblwgeom.h:108
#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
tuple g_size
Definition: genraster.py:42
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
#define MULTILINETYPE
Definition: liblwgeom.h:64
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
static LWPOINT * lwpoint_from_gserialized_buffer(uint8_t *data_ptr, uint8_t g_flags, size_t *g_size)
Definition: g_serialized.c:980
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: