function createGeometry(object, options) {
  if (!object) {
    return null;
  }
  if (Array.isArray(object)) {
    const geometries = object.map((geometry) =>
      createGeometry(geometry, options),
    );
    return new GeometryCollection(geometries);
  }
  const Geometry = GeometryConstructor[object.type];
  return transformGeometryWithOptions(
    new Geometry(object.flatCoordinates, object.layout || 'XY', object.ends),
    false,
    options,
  );
}
@param {GeometryObject|null} object Geometry object.
@param {WriteOptions|ReadOptions} [options] Options.
@return {import("../geom/Geometry.js").default} Geometry.