You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a Flatbush index that will hold a given number of items (`numItems`). Additionally accepts:
70
74
71
75
-`nodeSize`: size of the tree node (`16` by default); experiment with different values for best performance (increasing this value makes indexing faster and queries slower, and vise versa).
72
76
-`ArrayType`: the array type used for coordinates storage (`Float64Array` by default);
73
77
other types may be faster in certain cases (e.g. `Int32Array` when your data is integer).
74
78
75
-
#### index.add(minX, minY, maxX, maxY)
79
+
#### `index.add(minX, minY, maxX, maxY)`
76
80
77
81
Adds a given rectangle to the index. Returns a zero-based, incremental number that represents the newly added rectangle.
78
82
79
-
#### index.finish()
83
+
#### `index.finish()`
80
84
81
85
Performs indexing of the added rectangles.
82
86
Their number must match the one provided when creating a `Flatbush` object.
Returns an array of indices of items intersecting or touching a given bounding box. Item indices refer to the value returned by [`index.add()`](#indexaddminx-miny-maxx-maxy).
87
91
@@ -96,7 +100,7 @@ and only includes it if the function returned a truthy value.
0 commit comments