PostGIS  2.1.10dev-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:61
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
Definition: ptarray.c:796
#define LW_FAILURE
Definition: liblwgeom.h:54
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
Definition: lwcompound.c:132
uint8_t type
Definition: liblwgeom.h:352
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:697
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67

Here is the call graph for this function:

Here is the caller graph for this function: