PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_chaikin()

static LWCOLLECTION* lwcollection_chaikin ( const LWCOLLECTION igeom,
int  n_iterations,
int  preserve_endpoint 
)
static

Definition at line 162 of file lwchaikins.c.

163 {
164  LWDEBUG(2, "Entered lwcollection_set_effective_area");
165  uint32_t i;
166 
167  LWCOLLECTION *out = lwcollection_construct_empty(igeom->type, igeom->srid, FLAGS_GET_Z(igeom->flags), FLAGS_GET_M(igeom->flags));
168 
169  if( lwcollection_is_empty(igeom) )
170  return out; /* should we return NULL instead ? */
171 
172  for( i = 0; i < igeom->ngeoms; i++ )
173  {
174  LWGEOM *ngeom = lwgeom_chaikin(igeom->geoms[i],n_iterations,preserve_endpoint);
175  if ( ngeom ) out = lwcollection_add_lwgeom(out, ngeom);
176  }
177 
178  return out;
179 }
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187
int lwcollection_is_empty(const LWCOLLECTION *col)
Definition: lwcollection.c:508
LWGEOM * lwgeom_chaikin(const LWGEOM *igeom, int n_iterations, int preserve_endpoint)
Definition: lwchaikins.c:182
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
uint32_t ngeoms
Definition: liblwgeom.h:510
uint8_t type
Definition: liblwgeom.h:506
uint8_t flags
Definition: liblwgeom.h:507
LWGEOM ** geoms
Definition: liblwgeom.h:512
int32_t srid
Definition: liblwgeom.h:509
unsigned int uint32_t
Definition: uthash.h:78

References LWCOLLECTION::flags, FLAGS_GET_M, FLAGS_GET_Z, LWCOLLECTION::geoms, lwcollection_add_lwgeom(), lwcollection_construct_empty(), lwcollection_is_empty(), LWDEBUG, lwgeom_chaikin(), LWCOLLECTION::ngeoms, LWCOLLECTION::srid, and LWCOLLECTION::type.

Referenced by lwgeom_chaikin().

Here is the call graph for this function:
Here is the caller graph for this function: