|
2 | 2 |
|
3 | 3 | A really fast **static spatial index** for 2D points and rectangles in JavaScript. |
4 | 4 |
|
5 | | -An efficient implementation of the [packed Hilbert R-tree](https://en.wikipedia.org/wiki/Hilbert_R-tree#Packed_Hilbert_R-trees) algorithm. Enables fast spatial queries on a very large number of objects (e.g. millions), which is very useful in maps, data visualizations and computational geometry algorithms. |
6 | | - |
7 | | -Similar to [RBush](https://github.com/mourner/rbush), with the following key differences: |
| 5 | +An efficient implementation of the [packed Hilbert R-tree](https://en.wikipedia.org/wiki/Hilbert_R-tree#Packed_Hilbert_R-trees) algorithm. Enables fast spatial queries on a very large number of objects (e.g. millions), which is very useful in maps, data visualizations and computational geometry algorithms. Similar to [RBush](https://github.com/mourner/rbush), with the following key differences: |
8 | 6 |
|
9 | 7 | - **Static**: you can't add/remove items after initial indexing. |
10 | 8 | - **Faster** indexing and search, with much lower **memory** footprint. |
11 | | -- Index is stored as a single **array buffer** (so you can [transfer](https://developer.mozilla.org/en-US/docs/Glossary/Transferable_objects) it between threads or store it as a compact binary file). |
| 9 | +- Index is stored as a single **array buffer** (to [transfer](https://developer.mozilla.org/en-US/docs/Glossary/Transferable_objects) between threads or save as a compact binary file). |
12 | 10 |
|
13 | | -Supports geographic locations with the [geoflatbush](https://github.com/mourner/geoflatbush) extension. |
| 11 | +Supports geographic locations with the [geoflatbush](https://github.com/mourner/geoflatbush) extension. See also: [KDBush](https://github.com/mourner/kdbush), a similar library for points. |
14 | 12 |
|
15 | 13 | [](https://github.com/mourner/flatbush/actions) [](https://esm.run/flatbush) [](https://github.com/mourner/projects) |
16 | 14 |
|
@@ -112,7 +110,7 @@ const ids = index.neighbors(10, 10, 5); // returns 5 ids |
112 | 110 | `maxResults` and `maxDistance` are `Infinity` by default. |
113 | 111 | Also accepts a `filterFn` similar to `index.search`. |
114 | 112 |
|
115 | | -#### `Flatbush.from(data)` |
| 113 | +#### `Flatbush.from(data[, byteOffset])` |
116 | 114 |
|
117 | 115 | Recreates a Flatbush index from raw `ArrayBuffer` or `SharedArrayBuffer` data |
118 | 116 | (that's exposed as `index.data` on a previously indexed Flatbush instance). |
|
0 commit comments