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

◆ 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 484 of file lwpoly.c.

485{
486 double result=0.0;
487 uint32_t i;
488
489 LWDEBUGF(2, "in lwgeom_polygon_perimeter (%d rings)", poly->nrings);
490
491 for (i=0; i<poly->nrings; i++)
492 result += ptarray_length_2d(poly->rings[i]);
493
494 return result;
495}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
double ptarray_length_2d(const POINTARRAY *pts)
Find the 2d length of the given POINTARRAY (even if it's 3d)
Definition ptarray.c:1975
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106
POINTARRAY ** rings
Definition liblwgeom.h:519
uint32_t nrings
Definition liblwgeom.h:524

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

Referenced by lwgeom_perimeter_2d().

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