function toFeature(renderFeature, geometryName) {
  const id = renderFeature.getId();
  const geometry = toGeometry(renderFeature);
  const properties = renderFeature.getProperties();
  const feature = new Feature();
  if (geometryName !== undefined) {
    feature.setGeometryName(geometryName);
  }
  feature.setGeometry(geometry);
  if (id !== undefined) {
    feature.setId(id);
  }
  feature.setProperties(properties, true);
  return feature;
}
Create an `ol/Feature` from an `ol/render/Feature`
@param {RenderFeature} renderFeature RenderFeature
@param {string} [geometryName] Geometry name to use
when creating the Feature.
@return {Feature} Newly constructed `ol/Feature` with properties,
geometry, and id copied over.
@api