PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_filter_m_ignore_null()

static LWGEOM * lwgeom_filter_m_ignore_null ( LWGEOM geom,
double  min,
double  max,
int  returnm 
)
static

Definition at line 173 of file lwmval.c.

174 {
175  LWDEBUGF(2, "Entered %s",__func__);
176 
177  LWGEOM *geom_out = NULL;
178 
179  if(!FLAGS_GET_M(geom->flags))
180  return geom;
181  switch ( geom->type )
182  {
183  case POINTTYPE:
184  {
185  LWDEBUGF(4,"Type found is Point, %d", geom->type);
186  geom_out = lwpoint_as_lwgeom(lwpoint_filterm((LWPOINT*) geom, min, max,returnm));
187  break;
188  }
189  case LINETYPE:
190  {
191  LWDEBUGF(4,"Type found is Linestring, %d", geom->type);
192  geom_out = lwline_as_lwgeom(lwline_filterm((LWLINE*) geom, min,max,returnm));
193  break;
194  }
195  /* Polygon has 'nrings' and 'rings' elements */
196  case POLYGONTYPE:
197  {
198  LWDEBUGF(4,"Type found is Polygon, %d", geom->type);
199  geom_out = lwpoly_as_lwgeom(lwpoly_filterm((LWPOLY*)geom, min, max,returnm));
200  break;
201  }
202 
203  /* All these Collection types have 'ngeoms' and 'geoms' elements */
204  case MULTIPOINTTYPE:
205  case MULTILINETYPE:
206  case MULTIPOLYGONTYPE:
207  case COLLECTIONTYPE:
208  {
209  LWDEBUGF(4,"Type found is collection, %d", geom->type);
210  geom_out = (LWGEOM*) lwcollection_filterm((LWCOLLECTION*) geom, min, max,returnm);
211  break;
212  }
213  /* Unknown type! */
214  default:
215  lwerror("Unsupported geometry type: %s [%d] in function %s", lwtype_name((geom)->type), (geom)->type, __func__);
216  }
217  return geom_out;
218 
219 }
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:330
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:320
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:335
#define POLYGONTYPE
Definition: liblwgeom.h:87
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
static LWCOLLECTION * lwcollection_filterm(const LWCOLLECTION *igeom, double min, double max, int returnm)
Definition: lwmval.c:153
static LWPOINT * lwpoint_filterm(LWPOINT *pt, double min, double max, int returnm)
Definition: lwmval.c:83
static LWLINE * lwline_filterm(LWLINE *line, double min, double max, int returnm)
Definition: lwmval.c:99
static LWPOLY * lwpoly_filterm(LWPOLY *poly, double min, double max, int returnm)
Definition: lwmval.c:115
type
Definition: ovdump.py:41
uint8_t type
Definition: liblwgeom.h:399
uint8_t flags
Definition: liblwgeom.h:400

References COLLECTIONTYPE, LWGEOM::flags, FLAGS_GET_M, LINETYPE, lwcollection_filterm(), LWDEBUGF, lwerror(), lwline_as_lwgeom(), lwline_filterm(), lwpoint_as_lwgeom(), lwpoint_filterm(), lwpoly_as_lwgeom(), lwpoly_filterm(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, LWGEOM::type, and ovdump::type.

Referenced by lwcollection_filterm(), and lwgeom_filter_m().

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