PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ _lwt_EdgeRingSignedArea()

static double _lwt_EdgeRingSignedArea ( LWT_EDGERING_POINT_ITERATOR it)
static

Definition at line 6642 of file lwgeom_topo.c.

6643 {
6644  POINT2D P1;
6645  POINT2D P2;
6646  POINT2D P3;
6647  double sum = 0.0;
6648  double x0, x, y1, y2;
6649 
6650  if ( ! _lwt_EdgeRingIterator_next(it, &P1) ) return 0.0;
6651  if ( ! _lwt_EdgeRingIterator_next(it, &P2) ) return 0.0;
6652 
6653  LWDEBUG(2, "_lwt_EdgeRingSignedArea");
6654 
6655  x0 = P1.x;
6656  while ( _lwt_EdgeRingIterator_next(it, &P3) )
6657  {
6658  x = P2.x - x0;
6659  y1 = P3.y;
6660  y2 = P1.y;
6661  sum += x * (y2-y1);
6662 
6663  /* Move forwards! */
6664  P1 = P2;
6665  P2 = P3;
6666  }
6667 
6668  return sum / 2.0;
6669 }
#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:6408
double y
Definition: liblwgeom.h:405
double x
Definition: liblwgeom.h:405

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: