On this page

Class default

Index

Constructors

Properties

coords:
    | Float32Array<ArrayBuffer>
    | Uint8Array<ArrayBuffer>
    | Float64Array<ArrayBuffer>
    | Uint32Array<ArrayBuffer>
    | Uint16Array<ArrayBuffer>
    | Int8Array<ArrayBuffer>
    | Uint8ClampedArray<ArrayBuffer>
    | Int16Array<ArrayBuffer>
    | Int32Array<ArrayBuffer>
ids: Uint32Array<ArrayBuffer> | Uint16Array<ArrayBuffer>
IndexArrayType: Uint16ArrayConstructor | Uint32ArrayConstructor
nodeSize: number
numItems: number

Methods

  • Add a point to the index.

    Parameters

    • x: number
    • y: number

    Returns number

    An incremental index associated with the added item (starting from 0).

  • Perform indexing of the added points.

    Returns this

  • Search the index for items within a given bounding box.

    Parameters

    • minX: number
    • minY: number
    • maxX: number
    • maxY: number

    Returns number[]

    An array of indices correponding to the found items.

  • Search the index for items within a given radius.

    Parameters

    • qx: number
    • qy: number
    • r: number

      Query radius.

    Returns number[]

    An array of indices correponding to the found items.

  • Search the index for items within a given radius, writing matching ids into out via indexed assignment (out[i] = id). Accepts any indexed-writable container — a typed array sized to the expected upper bound (allocation-free, fast) or a plain Array (which will grow as needed). Returns the number of matches written.

    Parameters

    • qx: number
    • qy: number
    • r: number

      Query radius.

    • out: number[] | TypedArray

      Container to write matching ids into.

    Returns number

    The number of matches written to out.

Was this helpful?
SDK JS
Reference
default