PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwpoly_perimeter_2d()

double lwpoly_perimeter_2d ( const LWPOLY poly)

Compute the sum of polygon rings length (forcing 2d computation).

Could use a more numerically stable calculator...

Definition at line 492 of file lwpoly.c.

References LWDEBUGF, LWPOLY::nrings, ptarray_length_2d(), and LWPOLY::rings.

Referenced by lwgeom_perimeter_2d().

493 {
494  double result=0.0;
495  uint32_t i;
496 
497  LWDEBUGF(2, "in lwgeom_polygon_perimeter (%d rings)", poly->nrings);
498 
499  for (i=0; i<poly->nrings; i++)
500  result += ptarray_length_2d(poly->rings[i]);
501 
502  return result;
503 }
double ptarray_length_2d(const POINTARRAY *pts)
Find the 2d length of the given POINTARRAY (even if it&#39;s 3d)
Definition: ptarray.c:1682
uint32_t nrings
Definition: liblwgeom.h:457
unsigned int uint32_t
Definition: uthash.h:78
POINTARRAY ** rings
Definition: liblwgeom.h:459
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
Here is the call graph for this function:
Here is the caller graph for this function: