PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ isOnSegment()

static int isOnSegment ( const POINT2D seg1,
const POINT2D seg2,
const POINT2D point 
)
static

Definition at line 645 of file lwgeom_functions_analytic.c.

646 {
647  double maxX;
648  double maxY;
649  double minX;
650  double minY;
651 
652  if (seg1->x > seg2->x)
653  {
654  maxX = seg1->x;
655  minX = seg2->x;
656  }
657  else
658  {
659  maxX = seg2->x;
660  minX = seg1->x;
661  }
662  if (seg1->y > seg2->y)
663  {
664  maxY = seg1->y;
665  minY = seg2->y;
666  }
667  else
668  {
669  maxY = seg2->y;
670  minY = seg1->y;
671  }
672 
673  POSTGIS_DEBUGF(3, "maxX minX/maxY minY: %.8f %.8f/%.8f %.8f", maxX, minX, maxY, minY);
674 
675  if (maxX < point->x || minX > point->x)
676  {
677  POSTGIS_DEBUGF(3, "X value %.8f falls outside the range %.8f-%.8f", point->x, minX, maxX);
678 
679  return 0;
680  }
681  else if (maxY < point->y || minY > point->y)
682  {
683  POSTGIS_DEBUGF(3, "Y value %.8f falls outside the range %.8f-%.8f", point->y, minY, maxY);
684 
685  return 0;
686  }
687  return 1;
688 }
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331

References POINT2D::x, pixval::x, POINT2D::y, and pixval::y.

Referenced by point_in_ring(), and point_in_ring_rtree().

Here is the caller graph for this function: