function writePolygonGeometry(polygon, options) {
  // Esri geometries use the left-hand rule
  const hasZM = getHasZM(polygon);
  return {
    hasZ: hasZM.hasZ,
    hasM: hasZM.hasM,
    rings: /** @type {Array<Array<EsriJSONPosition>>} */ (
      polygon.getCoordinates(false)
    ),
  };
}
@param {import("../geom/Polygon.js").default} polygon Geometry.
@param {import("./Feature.js").WriteOptions} [options] Write options.
@return {EsriJSONPolygon} EsriJSON geometry.