ST_CompactnessRatio computes the perimeter of a circle whose area is equal to the given POLYGON’s area, and returns the ratio of this computed perimeter to the given POLYGON’s perimeter.
Equivalent definition: ST_CompactnessRatio returns the square root of the POLYGON’s area divided by the area of the circle with circumference equal to the POLYGON’s perimeter.
Note: This uses the 2D perimeter/area of the POLYGON.
This function accepts only POLYGONs.
Examples
Note: In this example, both geometries have a perimeter equal to 24.