src/pip/readStream.js
/**
 * This function loads a WOF metadata file, CSV parses it, extracts fields,
 * pushes the ids onto an array, and calls the callback
 *
 * @param {string} datapath bundle path if string or sqlite or bundle when object
 * @param {string} layer
 * @param {boolean} localizedAdminNames
 * @param {function} callback
 */
This function loads a WOF metadata file, CSV parses it, extracts fields,
pushes the ids onto an array, and calls the callback

@param {string} datapath bundle path if string or sqlite or bundle when object
@param {string} layer
@param {boolean} localizedAdminNames
@param {function} callback
This function loads a WOF metadata file CSV parses it extracts fields pushes the ids onto an array and calls the callback @param { string } datapath bundle path if string or sqlite or bundle when object @param { string } layer @param { boolean } localizedAdminNames @param { function } callback
function readData(datapath, layer, localizedAdminNames, callback) {
  const features = [];
  const stream = config.sqlite === true ?
    readSqliteRecords(datapath, layer) :
    readBundleRecords(datapath, layer);
  stream
    .pipe(whosonfirst.recordHasIdAndProperties())
    .pipe(whosonfirst.isActiveRecord())
    .pipe(filterOutPointRecords.create())
    .pipe(filterOutHierarchylessNeighbourhoods.create())
    .pipe(filterOutCitylessNeighbourhoods.create())
    .pipe(extractFields.create(localizedAdminNames))
    .pipe(sink.obj((feature) => {
      features.push(feature);
    }))
    .on('finish', function() {
      callback(features);
    });
}
function readData ( datapath , layer , localizedAdminNames , callback ) { const features = [ ] ; const stream = config . sqlite === true ? readSqliteRecords ( datapath , layer ) : readBundleRecords ( datapath , layer ) ; stream . pipe ( whosonfirst . recordHasIdAndProperties ( ) ) . pipe ( whosonfirst . isActiveRecord ( ) ) . pipe ( filterOutPointRecords . create ( ) ) . pipe ( filterOutHierarchylessNeighbourhoods . create ( ) ) . pipe ( filterOutCitylessNeighbourhoods . create ( ) ) . pipe ( extractFields . create ( localizedAdminNames ) ) . pipe ( sink . obj ( ( feature ) => { features . push ( feature ) ; } ) ) . on ( 'finish' , function ( ) { callback ( features ) ; } ) ; }
This function loads a WOF metadata file, CSV parses it, extracts fields,
 pushes the ids onto an array, and calls the callback
This function loads a WOF metadata file CSV parses it extracts fields pushes the ids onto an array and calls the callback