PostGIS  2.2.7dev-r@@SVN_REVISION@@
int lwgeom_contains_point ( const LWGEOM geom,
const POINT2D pt 
)

Definition at line 116 of file lwcompound.c.

References CIRCSTRINGTYPE, COMPOUNDTYPE, LINETYPE, LW_FAILURE, lwcompound_contains_point(), lwerror(), ptarray_contains_point(), ptarrayarc_contains_point(), and LWGEOM::type.

Referenced by lw_dist2d_curvepoly_curvepoly(), lw_dist2d_line_curvepoly(), and lw_dist2d_point_curvepoly().

117 {
118  switch( geom->type )
119  {
120  case LINETYPE:
121  return ptarray_contains_point(((LWLINE*)geom)->points, pt);
122  case CIRCSTRINGTYPE:
123  return ptarrayarc_contains_point(((LWCIRCSTRING*)geom)->points, pt);
124  case COMPOUNDTYPE:
125  return lwcompound_contains_point((LWCOMPOUND*)geom, pt);
126  }
127  lwerror("lwgeom_contains_point failed");
128  return LW_FAILURE;
129 }
#define LINETYPE
Definition: liblwgeom.h:71
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
Definition: ptarray.c:832
#define LW_FAILURE
Definition: liblwgeom.h:64
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
Definition: lwcompound.c:132
uint8_t type
Definition: liblwgeom.h:380
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
Return 1 if the point is inside the POINTARRAY, -1 if it is outside, and 0 if it is on the boundary...
Definition: ptarray.c:733
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74

Here is the call graph for this function:

Here is the caller graph for this function: