139 int preserve_endpoints=1;
143 PG_RETURN_POINTER(geom);
145 if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) )
146 n_iterations = PG_GETARG_INT32(1);
148 if (n_iterations< 1 || n_iterations>5)
149 elog(ERROR,
"Number of iterations must be between 1 and 5 : %s", __func__);
151 if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) )
153 if(PG_GETARG_BOOL(2))
154 preserve_endpoints = 1;
156 preserve_endpoints = 0;
162 if ( ! out ) PG_RETURN_NULL();
169 PG_FREE_IF_COPY(geom, 0);
170 PG_RETURN_POINTER(result);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
void lwgeom_free(LWGEOM *geom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
LWGEOM * lwgeom_chaikin(const LWGEOM *igeom, int n_iterations, int preserve_endpoint)
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)