1445{
1447 int32_t srid = 0;
1448 uint32_t lwtype = 0;
1449 uint8_t *data_ptr = NULL;
1452 size_t size = 0;
1453
1454 assert(g);
1455
1459
1461
1462 data_ptr = (uint8_t*)g->
data;
1465
1467
1468 if ( ! lwgeom )
1469 lwerror(
"%s: unable create geometry", __func__);
1470
1471 lwgeom->
type = lwtype;
1473
1475 {
1477 }
1479 {
1481 }
1482 else
1483 {
1484 lwgeom->
bbox = NULL;
1485 }
1486
1488
1489 return lwgeom;
1490}
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.
lwflags_t gserialized1_get_lwflags(const GSERIALIZED *g)
Read the flags from a GSERIALIZED and return a standard lwflag integer.
int32_t gserialized1_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
uint32_t gserialized1_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
static LWGEOM * lwgeom_from_gserialized1_buffer(uint8_t *data_ptr, lwflags_t lwflags, size_t *size)
static int gserialized1_read_gbox_p(const GSERIALIZED *g, GBOX *gbox)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UN...
#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.