src/ol/format/TopoJSON.js
function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {
  let geometry;
  const type = object.type;
  const geometryReader = GEOMETRY_READERS[type];
  if ((type === 'Point') || (type === 'MultiPoint')) {
    geometry = geometryReader(object, scale, translate);
  } else {
    geometry = geometryReader(object, arcs);
  }
  const feature = new Feature();
  feature.setGeometry(transformGeometryWithOptions(geometry, false, opt_options));
  if (object.id !== undefined) {
    feature.setId(object.id);
  }
  let properties = object.properties;
  if (property) {
    if (!properties) {
      properties = {};
    }
    properties[property] = name;
  }
  if (properties) {
    feature.setProperties(properties, true);
  }
  return feature;
}
function readFeatureFromGeometry(object, arcs, scale, translate, property, name, opt_options) {
  let geometry;
  const type = object.type;
  const geometryReader = GEOMETRY_READERS[type];
  if ((type === 'Point') || (type === 'MultiPoint')) {
    geometry = geometryReader(object, scale, translate);
  } else {
    geometry = geometryReader(object, arcs);
  }
  const feature = new Feature();
  feature.setGeometry(transformGeometryWithOptions(geometry, false, opt_options));
  if (object.id !== undefined) {
    feature.setId(object.id);
  }
  let properties = object.properties;
  if (property) {
    if (!properties) {
      properties = {};
    }
    properties[property] = name;
  }
  if (properties) {
    feature.setProperties(properties, true);
  }
  return feature;
}
function readFeatureFromGeometry ( object , arcs , scale , translate , property , name , opt_options ) { let geometry ; const type = object . type ; const geometryReader = GEOMETRY_READERS [ type ] ; if ( ( type === 'Point' ) || ( type === 'MultiPoint' ) ) { geometry = geometryReader ( object , scale , translate ) ; } else { geometry = geometryReader ( object , arcs ) ; } const feature = new Feature ( ) ; feature . setGeometry ( transformGeometryWithOptions ( geometry , false , opt_options ) ) ; if ( object . id !== undefined ) { feature . setId ( object . id ) ; } let properties = object . properties ; if ( property ) { if ( ! properties ) { properties = { } ; } properties [ property ] = name ; } if ( properties ) { feature . setProperties ( properties , true ) ; } return feature ; }
Create a feature from a TopoJSON geometry object.

@param {TopoJSONGeometry} object TopoJSON geometry object.
@param {Array<Array<import("../coordinate.js").Coordinate>>} arcs Array of arcs.
@param {Array<number>} scale Scale for each dimension.
@param {Array<number>} translate Translation for each dimension.
@param {string|undefined} property Property to set the `GeometryCollection`'s parent
object to.
@param {string} name Name of the `Topology`'s child object.
@param {import("./Feature.js").ReadOptions=} opt_options Read options.
@return {Feature} Feature.
Create a feature from a TopoJSON geometry object .