gis-tools-ts - v0.6.0
    Preparing search index...

    Class CSVReader<M, D, P>

    CSV Reader

    Parse (Geo|S2)JSON from a file that is in the CSV format Implements the FeatureIterator interface

    import { CSVReader } from 'gis-tools-ts';
    import { FileReader } from 'gis-tools-ts/file';

    const fileReader = new FileReader(`${__dirname}/fixtures/basic3D.csv`);
    const csvReader = new CSVReader(fileReader, {
    // set options, completely optional, but the values you see are the default.
    delimiter: ',', // how the CSV document separates values
    lineDelimiter: '\n', // the line delimiter, sometimes "\r\n" or some specializ unicode character
    lonKey: 'Longitude', // the key to use to store the longitude
    latKey: 'Latitude', // the key to use to store the latitude
    heightKey: 'height', // the key to use for the height or "z-value"
    });

    // read the features
    for await (const feature of csvReader) {
    console.log(feature);
    }

    Type Parameters

    • M = Record<string, unknown>
    • D extends MValue = MValue
    • P extends Properties = Properties

    Implements

    Index

    Constructors

    Methods

    Constructors

    • Type Parameters

      • M = Record<string, unknown>
      • D extends Properties = Properties
      • P extends Properties = Properties

      Parameters

      Returns CSVReader<M, D, P>

    Methods

    • Generator to iterate over each (Geo|S2)JSON object in the file

      Returns AsyncGenerator<VectorFeature<M, D, P>>