findMinimumLayout(geom, layout = 'XYZM') {
    /**
     * @param {import("../geom/Geometry.js").GeometryLayout} a A
     * @param {import("../geom/Geometry.js").GeometryLayout} b B
     * @return {import("../geom/Geometry.js").GeometryLayout} minimum layout made by common axes
     */
    const GeometryLayout_min = (a, b) => {
      if (a === b) {
        return a;
      }

      if (a === 'XYZM') {
        // anything `b` is minimum
        return b;
      }
      if (b === 'XYZM') {
        // anything `a` is minimum
        return a;
      }

      // otherwise, incompatible
      return 'XY';
    };

    if (geom instanceof SimpleGeometry) {
      return GeometryLayout_min(geom.getLayout(), layout);
    }

    if (geom instanceof GeometryCollection) {
      const geoms = geom.getGeometriesArray();
      for (let i = 0; i < geoms.length && layout !== 'XY'; i++) {
        layout = this.findMinimumLayout(geoms[i], layout);
      }
    }

    return layout;
  }
@param {import("../geom/Geometry.js").default} geom geometry
@param {import("../geom/Geometry.js").GeometryLayout} [layout] layout
@return {import("../geom/Geometry.js").GeometryLayout} minimum layout made by common axes