1499{
1501 int32_t srid = 0;
1502 uint32_t lwtype = 0;
1503 uint8_t *data_ptr = NULL;
1506 size_t size = 0;
1507
1508 assert(g);
1509
1513
1515
1516 data_ptr = (uint8_t*)g->
data;
1517
1518
1520 {
1521 data_ptr += sizeof(uint64_t);
1522 }
1523
1524
1527
1529
1530 if (!lwgeom)
1531 lwerror(
"%s: unable create geometry", __func__);
1532
1533 lwgeom->
type = lwtype;
1535
1537 {
1539 }
1541 {
1543 }
1544 else
1545 {
1546 lwgeom->
bbox = NULL;
1547 }
1548
1549 return lwgeom;
1550}
size_t gbox_serialized_size(lwflags_t flags)
Return the number of bytes necessary to hold a GBOX of this dimension in serialized form.
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
static int gserialized2_read_gbox_p(const GSERIALIZED *g, GBOX *gbox)
int32_t gserialized2_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
uint32_t gserialized2_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
static LWGEOM * lwgeom_from_gserialized2_buffer(uint8_t *data_ptr, lwflags_t lwflags, size_t *size, int32_t srid)
lwflags_t gserialized2_get_lwflags(const GSERIALIZED *g)
Read the flags from a GSERIALIZED and return a standard lwflag integer.
#define G2FLAGS_GET_EXTENDED(gflags)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define FLAGS_GET_BBOX(flags)
int lwgeom_needs_bbox(const LWGEOM *geom)
Check whether or not a lwgeom is big enough to warrant a bounding box.
int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox)
Calculate bounding box of a geometry, automatically taking into account whether it is cartesian or ge...
lwflags_t lwflags(int hasz, int hasm, int geodetic)
Construct a new flags bitmask.
#define LWDEBUGF(level, msg,...)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.