Options
All
  • Public
  • Public/Protected
  • All
Menu

Module packedrtree

Index

Interfaces

Type aliases

Variables

Functions

Type aliases

SearchResult

SearchResult: [number, number]

A feature found to be within the bounding box rect

(offset, index) offset: Byte offset in feature data section index: feature number

Variables

Const DEFAULT_NODE_SIZE

DEFAULT_NODE_SIZE: number = 16

Const NODE_ITEM_LEN

NODE_ITEM_LEN: number = ...

Functions

calcTreeSize

  • calcTreeSize(numItems: number, nodeSize: number): number
  • Parameters

    • numItems: number
    • nodeSize: number

    Returns number

streamSearch

  • streamSearch(numItems: number, nodeSize: number, rect: Rect, readNode: ReadNodeFn): AsyncGenerator<SearchResult, void, unknown>
  • Yield's a SearchResult for each feature within the bounds of rect.

    Every node in the FGB index tree has a bounding rect, all of the nodes children are contained within that bounding rect. The leaf nodes of the tree represent the features of the collection.

    As we traverse the tree, starting from the root, we'll need to read more data from the index. When we don't already have this range data buffered locally, an HTTP fetch is triggered. For performance, we merge adjacent and nearby request ranges into a single request, reasoning that fetching a few extra bytes is a good tradeoff if it means we can reduce the number of requests.

    Parameters

    • numItems: number
    • nodeSize: number
    • rect: Rect
    • readNode: ReadNodeFn

    Returns AsyncGenerator<SearchResult, void, unknown>

Generated using TypeDoc