PostGIS  2.5.0dev-r@@SVN_REVISION@@
static double _lwt_EdgeRingSignedArea ( LWT_EDGERING_POINT_ITERATOR it)
static

Definition at line 6509 of file lwgeom_topo.c.

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

Referenced by _lwt_EdgeRingIsCCW().

6510 {
6511  POINT2D P1;
6512  POINT2D P2;
6513  POINT2D P3;
6514  double sum = 0.0;
6515  double x0, x, y1, y2;
6516 
6517  if ( ! _lwt_EdgeRingIterator_next(it, &P1) ) return 0.0;
6518  if ( ! _lwt_EdgeRingIterator_next(it, &P2) ) return 0.0;
6519 
6520  LWDEBUG(2, "_lwt_EdgeRingSignedArea");
6521 
6522  x0 = P1.x;
6523  while ( _lwt_EdgeRingIterator_next(it, &P3) )
6524  {
6525  x = P2.x - x0;
6526  y1 = P3.y;
6527  y2 = P1.y;
6528  sum += x * (y2-y1);
6529 
6530  /* Move forwards! */
6531  P1 = P2;
6532  P2 = P3;
6533  }
6534 
6535  return sum / 2.0;
6536 }
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
double x
Definition: liblwgeom.h:327
static int _lwt_EdgeRingIterator_next(LWT_EDGERING_POINT_ITERATOR *it, POINT2D *pt)
Definition: lwgeom_topo.c:6276
double y
Definition: liblwgeom.h:327
tuple x
Definition: pixval.py:53

Here is the call graph for this function:

Here is the caller graph for this function: