function readFeatureFromGeometry(
  object,
  arcs,
  scale,
  translate,
  property,
  name,
  opt_options
) {
  let geometry = null;
  const type = object.type;
  if (type) {
    const geometryReader = GEOMETRY_READERS[type];
    if (type === 'Point' || type === 'MultiPoint') {
      geometry = geometryReader(object, scale, translate);
    } else {
      geometry = geometryReader(object, arcs);
    }
    geometry = transformGeometryWithOptions(geometry, false, opt_options);
  }
  const feature = new Feature({geometry: geometry});
  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.
Create a feature from a TopoJSON geometry object .
function readFeatureFromGeometry(
  object,
  arcs,
  scale,
  translate,
  property,
  name,
  opt_options
) {
  let geometry = null;
  const type = object.type;
  if (type) {
    const geometryReader = GEOMETRY_READERS[type];
    if (type === 'Point' || type === 'MultiPoint') {
      geometry = geometryReader(object, scale, translate);
    } else {
      geometry = geometryReader(object, arcs);
    }
    geometry = transformGeometryWithOptions(geometry, false, opt_options);
  }
  const feature = new Feature({geometry: geometry});
  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 = null ; const type = object . type ; if ( type ) { const geometryReader = GEOMETRY_READERS [ type ] ; if ( type === 'Point' || type === 'MultiPoint' ) { geometry = geometryReader ( object , scale , translate ) ; } else { geometry = geometryReader ( object , arcs ) ; } geometry = transformGeometryWithOptions ( geometry , false , opt_options ) ; } const feature = new Feature ( { geometry : geometry } ) ; 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.
Create a feature from a TopoJSON geometry object .