137 int preserve_endpoints=1;
141 PG_RETURN_POINTER(geom);
143 if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) )
144 n_iterations = PG_GETARG_INT32(1);
146 if (n_iterations< 1 || n_iterations>5)
147 elog(ERROR,
"Number of iterations must be between 1 and 5 : %s", __func__);
149 if ( (PG_NARGS()>2) && (!PG_ARGISNULL(2)) )
151 if(PG_GETARG_BOOL(2))
152 preserve_endpoints = 1;
154 preserve_endpoints = 0;
160 if ( ! out ) PG_RETURN_NULL();
167 PG_FREE_IF_COPY(geom, 0);
168 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 *g)
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)