691 StringInfo buf = (StringInfo) PG_GETARG_POINTER(0);
692 int32 geom_typmod = -1;
696 if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) ) {
697 geom_typmod = PG_GETARG_INT32(2);
706 buf->cursor = buf->len;
708 geom = geometry_serialize(lwgeom);
711 if ( geom_typmod >= 0 )
714 POSTGIS_DEBUG(3,
"typmod and geometry were consistent");
718 POSTGIS_DEBUG(3,
"typmod was -1");
722 PG_RETURN_POINTER(geom);
GSERIALIZED * postgis_valid_typmod(GSERIALIZED *gser, int32_t typmod)
Check the consistency of the metadata we want to enforce in the typmod: srid, type and dimensionality...
#define LW_PARSER_CHECK_ALL
void lwgeom_free(LWGEOM *geom)
int lwgeom_needs_bbox(const LWGEOM *geom)
Check whether or not a lwgeom is big enough to warrant a bounding box.
LWGEOM * lwgeom_from_wkb(const uint8_t *wkb, const size_t wkb_size, const char check)
WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory...
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.