PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_contains_point()

int lwgeom_contains_point ( const LWGEOM geom,
const POINT2D pt 
)

Definition at line 129 of file lwcompound.c.

130 {
131  switch( geom->type )
132  {
133  case LINETYPE:
134  return ptarray_contains_point(((LWLINE*)geom)->points, pt);
135  case CIRCSTRINGTYPE:
136  return ptarrayarc_contains_point(((LWCIRCSTRING*)geom)->points, pt);
137  case COMPOUNDTYPE:
138  return lwcompound_contains_point((LWCOMPOUND*)geom, pt);
139  }
140  lwerror("lwgeom_contains_point failed");
141  return LW_FAILURE;
142 }
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define LW_FAILURE
Definition: liblwgeom.h:79
#define LINETYPE
Definition: liblwgeom.h:86
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
Definition: ptarray.c:833
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:734
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
Definition: lwcompound.c:145
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
uint8_t type
Definition: liblwgeom.h:399

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().

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