PostGIS  2.1.10dev-r@@SVN_REVISION@@
int isOnSegment ( POINT2D seg1,
POINT2D seg2,
POINT2D point 
)

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

872 {
873  double maxX;
874  double maxY;
875  double minX;
876  double minY;
877 
878  if (seg1->x > seg2->x)
879  {
880  maxX = seg1->x;
881  minX = seg2->x;
882  }
883  else
884  {
885  maxX = seg2->x;
886  minX = seg1->x;
887  }
888  if (seg1->y > seg2->y)
889  {
890  maxY = seg1->y;
891  minY = seg2->y;
892  }
893  else
894  {
895  maxY = seg2->y;
896  minY = seg1->y;
897  }
898 
899  POSTGIS_DEBUGF(3, "maxX minX/maxY minY: %.8f %.8f/%.8f %.8f", maxX, minX, maxY, minY);
900 
901  if (maxX < point->x || minX > point->x)
902  {
903  POSTGIS_DEBUGF(3, "X value %.8f falls outside the range %.8f-%.8f", point->x, minX, maxX);
904 
905  return 0;
906  }
907  else if (maxY < point->y || minY > point->y)
908  {
909  POSTGIS_DEBUGF(3, "Y value %.8f falls outside the range %.8f-%.8f", point->y, minY, maxY);
910 
911  return 0;
912  }
913  return 1;
914 }
double x
Definition: liblwgeom.h:284
double y
Definition: liblwgeom.h:284
tuple x
Definition: pixval.py:53
tuple y
Definition: pixval.py:54

Here is the caller graph for this function: