PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWCOLLECTION* lwcollection_simplify ( const LWCOLLECTION igeom,
double  dist,
int  preserve_collapsed 
)

Definition at line 519 of file lwcollection.c.

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

Referenced by lwgeom_simplify().

520 {
521  int i;
522  LWCOLLECTION *out = lwcollection_construct_empty(igeom->type, igeom->srid, FLAGS_GET_Z(igeom->flags), FLAGS_GET_M(igeom->flags));
523 
524  if( lwcollection_is_empty(igeom) )
525  return out; /* should we return NULL instead ? */
526 
527  for( i = 0; i < igeom->ngeoms; i++ )
528  {
529  LWGEOM *ngeom = lwgeom_simplify(igeom->geoms[i], dist, preserve_collapsed);
530  if ( ngeom ) out = lwcollection_add_lwgeom(out, ngeom);
531  }
532 
533  return out;
534 }
uint8_t type
Definition: liblwgeom.h:502
int lwcollection_is_empty(const LWCOLLECTION *col)
Definition: lwcollection.c:494
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
uint8_t flags
Definition: liblwgeom.h:503
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187
LWGEOM ** geoms
Definition: liblwgeom.h:508
LWGEOM * lwgeom_simplify(const LWGEOM *igeom, double dist, int preserve_collapsed)
Definition: lwgeom.c:1571
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

Here is the call graph for this function:

Here is the caller graph for this function: