rslearn.utils.grid_index¶
grid_index ¶
GridIndex spatial index implementation.
GridIndex ¶
Bases: SpatialIndex
An index of temporal geometries using a grid.
Each cell in the grid contains a list of geometries that intersect it.
Source code in rslearn/utils/grid_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 |
Source code in rslearn/utils/grid_index.py
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 |