rslearn.utils.sqlite_index¶
sqlite_index ¶
Contains a SpatialIndex implementation that uses an sqlite database.
TODO: This is not yet complete decide to either complete it or remove this file.¶
SqliteIndex ¶
Bases: SpatialIndex
An index of spatiotemporal geometries backed by an sqlite database.
We do not use geospatial extensions. Actually, it looks like this is only partially implemented so we should either complete it or remove this file.
Source code in rslearn/utils/sqlite_index.py
insert ¶
insert(geometry: STGeometry, data: Any) -> None
Insert a geometry into the index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
STGeometry
|
the :class: |
required |
data
|
Any
|
arbitrary JSON-encodable object |
required |
Source code in rslearn/utils/sqlite_index.py
query ¶
query(geometry: STGeometry) -> list[Any]
Query the index for objects intersecting a geometry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
STGeometry
|
the :class:`STGeometry query |
required |
Returns:
| Type | Description |
|---|---|
list[Any]
|
a list of objects in the index intersecting the geometry |