PostGIS  2.5.0dev-r@@SVN_REVISION@@
static LWCOLLECTION* lwcollection_set_effective_area ( const LWCOLLECTION igeom,
int  set_area,
double  trshld 
)
static

Definition at line 516 of file effectivearea.c.

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

Referenced by lwgeom_set_effective_area().

517 {
518  LWDEBUG(2, "Entered lwcollection_set_effective_area");
519  uint32_t i;
520  int set_m;
521  if(set_area)
522  set_m=1;
523  else
524  set_m=FLAGS_GET_M(igeom->flags);
525  LWCOLLECTION *out = lwcollection_construct_empty(igeom->type, igeom->srid, FLAGS_GET_Z(igeom->flags), set_m);
526 
527  if( lwcollection_is_empty(igeom) )
528  return out; /* should we return NULL instead ? */
529 
530  for( i = 0; i < igeom->ngeoms; i++ )
531  {
532  LWGEOM *ngeom = lwgeom_set_effective_area(igeom->geoms[i],set_area,trshld);
533  if ( ngeom ) out = lwcollection_add_lwgeom(out, ngeom);
534  }
535 
536  return out;
537 }
uint8_t type
Definition: liblwgeom.h:502
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
uint32_t ngeoms
Definition: liblwgeom.h:506
LWGEOM * lwgeom_set_effective_area(const LWGEOM *igeom, int set_area, double trshld)
unsigned int uint32_t
Definition: uthash.h:78
uint8_t flags
Definition: liblwgeom.h:503
int lwcollection_is_empty(const LWCOLLECTION *col)
Definition: lwcollection.c:494
LWGEOM ** geoms
Definition: liblwgeom.h:508
int32_t srid
Definition: liblwgeom.h:505
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:139
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:140
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187

Here is the call graph for this function:

Here is the caller graph for this function: