PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ _lwt_EdgeRingSignedArea()

static double _lwt_EdgeRingSignedArea ( LWT_EDGERING_POINT_ITERATOR it)
static

Definition at line 401 of file lwgeom_topo_polygonizer.c.

402{
403 POINT2D P1;
404 POINT2D P2;
405 POINT2D P3;
406 double sum = 0.0;
407 double x0, x, y1, y2;
408
409 if ( ! _lwt_EdgeRingIterator_next(it, &P1) ) return 0.0;
410 if ( ! _lwt_EdgeRingIterator_next(it, &P2) ) return 0.0;
411
412 LWDEBUG(2, "_lwt_EdgeRingSignedArea");
413
414 x0 = P1.x;
415 while ( _lwt_EdgeRingIterator_next(it, &P3) )
416 {
417 x = P2.x - x0;
418 y1 = P3.y;
419 y2 = P1.y;
420 sum += x * (y2-y1);
421
422 /* Move forwards! */
423 P1 = P2;
424 P2 = P3;
425 }
426
427 return sum / 2.0;
428}
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:101
static int _lwt_EdgeRingIterator_next(LWT_EDGERING_POINT_ITERATOR *it, POINT2D *pt)
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390

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

Referenced by _lwt_EdgeRingIsCCW().

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