PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_contains_point()

int lwgeom_contains_point ( const LWGEOM geom,
const POINT2D pt 
)

Definition at line 129 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().

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 LINETYPE
Definition: liblwgeom.h:86
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
int ptarrayarc_contains_point(const POINTARRAY *pa, const POINT2D *pt)
For POINTARRAYs representing CIRCULARSTRINGS.
Definition: ptarray.c:835
#define LW_FAILURE
Definition: liblwgeom.h:79
int lwcompound_contains_point(const LWCOMPOUND *comp, const POINT2D *pt)
Definition: lwcompound.c:145
uint8_t type
Definition: liblwgeom.h:396
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:736
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
Here is the call graph for this function:
Here is the caller graph for this function: