rslearn.utils.spatial_index¶
spatial_index ¶
Abstract SpatialIndex class.
SpatialIndex ¶
An abstract class for spatial indices.
Source code in rslearn/utils/spatial_index.py
insert ¶
Insert a box into the index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
box
|
tuple[float, float, float, float]
|
the bounding box of this item (minx, miny, maxx, maxy) |
required |
data
|
Any
|
arbitrary object |
required |
query ¶
Query the index for objects intersecting a box.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
box
|
tuple[float, float, float, float]
|
the bounding box query (minx, miny, maxx, maxy) |
required |
Returns:
| Type | Description |
|---|---|
list[Any]
|
a list of objects in the index intersecting the box |