PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ lwgeom_contains_point()

int lwgeom_contains_point ( const LWGEOM geom,
const POINT2D pt 
)

Definition at line 172 of file lwcompound.c.

173 {
174  switch( geom->type )
175  {
176  case LINETYPE:
177  return ptarray_contains_point(((LWLINE*)geom)->points, pt);
178  case CIRCSTRINGTYPE:
179  return ptarrayarc_contains_point(((LWCIRCSTRING*)geom)->points, pt);
180  case COMPOUNDTYPE:
181  return lwcompound_contains_point((LWCOMPOUND*)geom, pt);
182  }
183  lwerror("lwgeom_contains_point failed");
184  return LW_FAILURE;
185 }
#define COMPOUNDTYPE
Definition: liblwgeom.h:110
#define LW_FAILURE
Definition: liblwgeom.h:96
#define LINETYPE
Definition: liblwgeom.h:103
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:109
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
Definition: ptarray.c:856
int ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
Return LW_INSIDE if the point is inside the POINTARRAY, LW_OUTSIDE if it is outside,...
Definition: ptarray.c:751
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
Definition: lwcompound.c:188
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
uint8_t type
Definition: liblwgeom.h:462

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(), lw_dist2d_point_curvepoly(), and lw_dist2d_tri_curvepoly().

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