code: 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;
      }
docs: Returns the compactness ratio of the given polygon
  
  @param geom Geometry
  @return The compactness ratio of the given polygon