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

    Class JSONReader<M, D, P>

    JSON Reader

    Parse (Geo|S2)JSON. Can handle millions of features. Implements the FeatureIterator interface

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

    const reader = new JSONReader(new FileReader('./data.geojson'));

    // read the features
    for await (const feature of reader) {
    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

      • input: ReaderInputs

        the input to parse from

      • OptionalchunkSize: number

        the number of bytes to read at a time from the reader. [Default: 65_536]

      Returns JSONReader<M, D, P>

    Methods

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

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