Build a spatial index from a flat Float64Array of coordinates [lng0, lat0, lng1, lat1, ...].
Each coordinate pair is assigned an ID equal to its index (i.e. 0 for the first pair, 1 for the second).
Find the K nearest neighbors to a given query coordinate.
Returns a Uint32Array containing the IDs, ordered by distance (nearest first).
If k is greater than the number of points, returns all points.
Find the nearest point to a given query coordinate.
Returns the ID of the nearest point, or null if the index is empty.
Search for all points within a given bounding box.
Returns a Uint32Array containing the IDs of the points.
Get the total number of points in the index.
A high-performance spatial index using an R-Tree.