PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_filterm()

static LWCOLLECTION* lwcollection_filterm ( const LWCOLLECTION igeom,
double  min,
double  max,
int  returnm 
)
static

Definition at line 153 of file lwmval.c.

154 {
155  LWDEBUGF(2, "Entered %s",__func__);
156 
157  uint32_t i;
158 
159  LWCOLLECTION *out = lwcollection_construct_empty(igeom->type, igeom->srid, FLAGS_GET_Z(igeom->flags),returnm * FLAGS_GET_M(igeom->flags));
160 
161  if( lwcollection_is_empty(igeom) )
162  return out;
163 
164  for( i = 0; i < igeom->ngeoms; i++ )
165  {
166  LWGEOM *ngeom = lwgeom_filter_m_ignore_null(igeom->geoms[i],min, max,returnm);
167  if ( ngeom ) out = lwcollection_add_lwgeom(out, ngeom);
168  }
169 
170  return out;
171 }
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
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
static LWGEOM * lwgeom_filter_m_ignore_null(LWGEOM *geom, double min, double max, int returnm)
Definition: lwmval.c:173
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(), LWDEBUGF, lwgeom_filter_m_ignore_null(), LWCOLLECTION::ngeoms, LWCOLLECTION::srid, and LWCOLLECTION::type.

Referenced by lwgeom_filter_m_ignore_null().

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