PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwpoly_perimeter()

double lwpoly_perimeter ( const LWPOLY poly)

Compute the sum of polygon rings length.

Could use a more numerically stable calculator...

Definition at line 467 of file lwpoly.c.

468 {
469  double result=0.0;
470  uint32_t i;
471 
472  LWDEBUGF(2, "in lwgeom_polygon_perimeter (%d rings)", poly->nrings);
473 
474  for (i=0; i<poly->nrings; i++)
475  result += ptarray_length(poly->rings[i]);
476 
477  return result;
478 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
double ptarray_length(const POINTARRAY *pts)
Find the 3d/2d length of the given POINTARRAY (depending on its dimensionality)
Definition: ptarray.c:1860
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
POINTARRAY ** rings
Definition: liblwgeom.h:519
uint32_t nrings
Definition: liblwgeom.h:524

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

Referenced by lwgeom_perimeter().

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