2903{
2904 GSERIALIZED *geom_in = PG_GETARG_GSERIALIZED_P(0);
2906 bool fits = PG_GETARG_BOOL(1);
2912 int32_t srid = lwgeom_in->
srid;
2915
2916 if (fits)
2917 {
2918
2919 lwgeom_in->
bbox = NULL;
2920 }
2921
2923
2924 if (!gbox)
2925 {
2927 }
2928 else
2929 {
2942 }
2943
2945 PG_FREE_IF_COPY(geom_in, 0);
2946
2949
2950 PG_RETURN_POINTER(geom_out);
2951}
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
#define FLAGS_GET_Z(flags)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
#define FLAGS_GET_M(flags)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
LWGEOM * lwgeom_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
#define LW_TRUE
Return types for functions with status returns.
const GBOX * lwgeom_get_bbox(const LWGEOM *lwgeom)
Get a non-empty geometry bounding box, computing and caching it if not already there.
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)