public static double lengthInMeters(Geometry latLonGeom) {
    return switch (latLonGeom) {
      case LineString line -> lineLengthMeters(line.getCoordinateSequence());
      case GeometryCollection collection -> {
        double result = 0;
        for (int i = 0; i < collection.getNumGeometries(); i++) {
          result += lengthInMeters(collection.getGeometryN(i));
        }
        yield result;
      }
      case null, default -> 0;
    };
  }
Returns the approximate length in meters of a line, or all lines contained within a multigeometry using
{@link #lineLengthMeters(CoordinateSequence)}.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/GeoUtils.java