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

    Class MMapVector<V>

    Vector MMap Store

    A mmap vector store

    import { MMapVector } from 'gis-tools-ts/mmap';
    import type { VectorKey } from 'gis-tools-ts';

    interface Data extends VectorKey { name: string };

    const vec = new MMapVector<Data>();
    // push an entry
    vec.push({ cell: 1n, name: 'test' });
    vec.push({ cell: 1n, name: 'test2' });
    // check if a key exists
    vec.has(1n); // true
    // get length of the store
    console.log(vec.length); // 2

    // iterate over the store
    for await (const entry of vec) console.log(entry);

    // close the store
    vec.close();

    Type Parameters

    Implements

    Index

    Constructors

    Accessors

    • get length(): number

      Returns number

      the length of the store

    Methods

    • iterate through the values

      Returns AsyncGenerator<V>

      an iterator

    • Closes the store

      Returns void

    • Parameters

      • index: number | bigint

        the position in the store to get the value from

      Returns Promise<V>

      the value

    • Check if the key exists

      Parameters

      • key: number | bigint

        the key

      Returns Promise<boolean>

      true if the key exists

    • Push a value into the store

      Parameters

      • value: V

        the value to store

      Returns void

    • Sort the store

      Returns Promise<void>

    • iterate through the values

      Returns AsyncGenerator<V>

      an iterator