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

Definition at line 496 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().

497 {
498  int i;
499  LWCOLLECTION *out = lwcollection_construct_empty(igeom->type, igeom->srid, FLAGS_GET_Z(igeom->flags), FLAGS_GET_M(igeom->flags));
500 
501  if( lwcollection_is_empty(igeom) )
502  return out; /* should we return NULL instead ? */
503 
504  for( i = 0; i < igeom->ngeoms; i++ )
505  {
506  LWGEOM *ngeom = lwgeom_simplify(igeom->geoms[i], dist);
507  if ( ngeom ) out = lwcollection_add_lwgeom(out, ngeom);
508  }
509 
510  return out;
511 }
uint8_t type
Definition: liblwgeom.h:459
int lwcollection_is_empty(const LWCOLLECTION *col)
Definition: lwcollection.c:471
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
uint8_t flags
Definition: liblwgeom.h:460
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:174
LWGEOM ** geoms
Definition: liblwgeom.h:465
int32_t srid
Definition: liblwgeom.h:462
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:107
LWGEOM * lwgeom_simplify(const LWGEOM *igeom, double dist)
Definition: lwgeom.c:1478

Here is the call graph for this function:

Here is the caller graph for this function: