PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ _lwt_EdgeRingSignedArea()

static double _lwt_EdgeRingSignedArea ( LWT_EDGERING_POINT_ITERATOR it)
static

Definition at line 6488 of file lwgeom_topo.c.

6489 {
6490  POINT2D P1;
6491  POINT2D P2;
6492  POINT2D P3;
6493  double sum = 0.0;
6494  double x0, x, y1, y2;
6495 
6496  if ( ! _lwt_EdgeRingIterator_next(it, &P1) ) return 0.0;
6497  if ( ! _lwt_EdgeRingIterator_next(it, &P2) ) return 0.0;
6498 
6499  LWDEBUG(2, "_lwt_EdgeRingSignedArea");
6500 
6501  x0 = P1.x;
6502  while ( _lwt_EdgeRingIterator_next(it, &P3) )
6503  {
6504  x = P2.x - x0;
6505  y1 = P3.y;
6506  y2 = P1.y;
6507  sum += x * (y2-y1);
6508 
6509  /* Move forwards! */
6510  P1 = P2;
6511  P2 = P3;
6512  }
6513 
6514  return sum / 2.0;
6515 }
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
static int _lwt_EdgeRingIterator_next(LWT_EDGERING_POINT_ITERATOR *it, POINT2D *pt)
Definition: lwgeom_topo.c:6254
double y
Definition: liblwgeom.h:390
double x
Definition: liblwgeom.h:390

References _lwt_EdgeRingIterator_next(), LWDEBUG, POINT2D::x, pixval::x, and POINT2D::y.

Referenced by _lwt_EdgeRingIsCCW().

Here is the call graph for this function:
Here is the caller graph for this function: