public static Double computeCompacity ( Geometry geom ) { if ( geom == null ) { return null ; } if ( geom instanceof Polygon ) { final double circleRadius = Math . sqrt ( geom . getArea ( ) / Math . PI ) ; final double circleCurcumference = 2 * Math . PI * circleRadius ; return circleCurcumference / geom . getLength ( ) ; } return null ; }
Returns the compactness ratio of the given polygon