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

    Class BufferJSONReader<M, D, P>

    JSON Buffer Reader

    Standard Buffer Reader for (Geo|S2)JSON implements the FeatureIterator interface

    import { BufferJSONReader } from 'gis-tools-ts';

    const reader = new BufferJSONReader(`{ type: 'FeatureCollection', features: [...] }`);
    // OR
    const reader = new BufferJSONReader({ type: 'FeatureCollection', features: [...] });
    // OR
    const reader = new BufferJSONReader(
    await fetch('example.com/data.json').then(async (res) => await res.text())
    );

    // 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

      • data: string | JSONCollection<M, D, P>

        the JSON data to parase

      Returns BufferJSONReader<M, D, P>

    Methods

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

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