public static double areaInMeters(Geometry latLonGeom) {
    return switch (latLonGeom) {
      case Polygon poly -> {
        double result = ringAreaMeters(poly.getExteriorRing().getCoordinateSequence());
        for (int i = 0; i < poly.getNumInteriorRing(); i++) {
          result -= ringAreaMeters(poly.getInteriorRingN(i).getCoordinateSequence());
        }
        yield result;
      }
      case GeometryCollection collection -> {
        double result = 0;
        for (int i = 0; i < collection.getNumGeometries(); i++) {
          result += areaInMeters(collection.getGeometryN(i));
        }
        yield result;
      }
      case null, default -> 0;
    };
  }
Returns the approximate area in meters of a polygon, or all polygons contained within a multigeometry using
{@link #ringAreaMeters(CoordinateSequence)}.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/GeoUtils.java