PostGIS  2.5.0dev-r@@SVN_REVISION@@
static int isOnSegment ( const POINT2D seg1,
const POINT2D seg2,
const POINT2D point 
)
static

Definition at line 600 of file lwgeom_functions_analytic.c.

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

Referenced by point_in_ring(), and point_in_ring_rtree().

601 {
602  double maxX;
603  double maxY;
604  double minX;
605  double minY;
606 
607  if (seg1->x > seg2->x)
608  {
609  maxX = seg1->x;
610  minX = seg2->x;
611  }
612  else
613  {
614  maxX = seg2->x;
615  minX = seg1->x;
616  }
617  if (seg1->y > seg2->y)
618  {
619  maxY = seg1->y;
620  minY = seg2->y;
621  }
622  else
623  {
624  maxY = seg2->y;
625  minY = seg1->y;
626  }
627 
628  POSTGIS_DEBUGF(3, "maxX minX/maxY minY: %.8f %.8f/%.8f %.8f", maxX, minX, maxY, minY);
629 
630  if (maxX < point->x || minX > point->x)
631  {
632  POSTGIS_DEBUGF(3, "X value %.8f falls outside the range %.8f-%.8f", point->x, minX, maxX);
633 
634  return 0;
635  }
636  else if (maxY < point->y || minY > point->y)
637  {
638  POSTGIS_DEBUGF(3, "Y value %.8f falls outside the range %.8f-%.8f", point->y, minY, maxY);
639 
640  return 0;
641  }
642  return 1;
643 }
double x
Definition: liblwgeom.h:327
double y
Definition: liblwgeom.h:327
tuple x
Definition: pixval.py:53
tuple y
Definition: pixval.py:54

Here is the caller graph for this function: