PostGIS  2.1.10dev-r@@SVN_REVISION@@
double lwpoly_perimeter ( const LWPOLY poly)

Compute the sum of polygon rings length.

Could use a more numerically stable calculator...

Definition at line 423 of file lwpoly.c.

References LWDEBUGF, LWPOLY::nrings, ptarray_length(), result, and LWPOLY::rings.

Referenced by lwgeom_perimeter().

424 {
425  double result=0.0;
426  int i;
427 
428  LWDEBUGF(2, "in lwgeom_polygon_perimeter (%d rings)", poly->nrings);
429 
430  for (i=0; i<poly->nrings; i++)
431  result += ptarray_length(poly->rings[i]);
432 
433  return result;
434 }
char ** result
Definition: liblwgeom.h:218
POINTARRAY ** rings
Definition: liblwgeom.h:413
int nrings
Definition: liblwgeom.h:411
double ptarray_length(const POINTARRAY *pts)
Find the 3d/2d length of the given POINTARRAY (depending on its dimensionality)
Definition: ptarray.c:1614
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the call graph for this function:

Here is the caller graph for this function: