double lwtriangle_perimeter(const LWTRIANGLE *triangle) { if( triangle->points ) return ptarray_length(triangle->points); else return 0.0; }
/** * Compute the sum of polygon rings length. * Could use a more numerically stable calculator... */ double lwpoly_perimeter(const LWPOLY *poly) { double result=0.0; int i; LWDEBUGF(2, "in lwgeom_polygon_perimeter (%d rings)", poly->nrings); for (i=0; i<poly->nrings; i++) result += ptarray_length(poly->rings[i]); return result; }