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

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

664 {
665  double maxX;
666  double maxY;
667  double minX;
668  double minY;
669 
670  if (seg1->x > seg2->x)
671  {
672  maxX = seg1->x;
673  minX = seg2->x;
674  }
675  else
676  {
677  maxX = seg2->x;
678  minX = seg1->x;
679  }
680  if (seg1->y > seg2->y)
681  {
682  maxY = seg1->y;
683  minY = seg2->y;
684  }
685  else
686  {
687  maxY = seg2->y;
688  minY = seg1->y;
689  }
690 
691  POSTGIS_DEBUGF(3, "maxX minX/maxY minY: %.8f %.8f/%.8f %.8f", maxX, minX, maxY, minY);
692 
693  if (maxX < point->x || minX > point->x)
694  {
695  POSTGIS_DEBUGF(3, "X value %.8f falls outside the range %.8f-%.8f", point->x, minX, maxX);
696 
697  return 0;
698  }
699  else if (maxY < point->y || minY > point->y)
700  {
701  POSTGIS_DEBUGF(3, "Y value %.8f falls outside the range %.8f-%.8f", point->y, minY, maxY);
702 
703  return 0;
704  }
705  return 1;
706 }
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: