We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fe20b8e commit 071d12bCopy full SHA for 071d12b
modules/app/src/main/java/org/locationtech/jtstest/function/MetricFunctions.java
@@ -84,4 +84,11 @@ public boolean isGeometryChanged() {
84
85
return geom.getFactory().createLineString(pts);
86
}
87
+
88
+ public static double compactness(Geometry poly) {
89
+ double perimeter = poly.getLength();
90
+ double area = poly.getArea();
91
+ if (perimeter <= 0) return 0;
92
+ return Math.abs(area) * Math.PI * 4 / (perimeter * perimeter);
93
+ }
94
0 commit comments