Skip to content

Introducing a spatial index interfaceΒ #131

@asinghvi17

Description

@asinghvi17

There are multiple implementations of spatial index trees in Julia: SortTileRecursiveTree, SpatialIndexing, LibSpatialIndex. The problem lies in that there is no single API to query any of these. They all return the same thing, we just need a common API to query them.

If we get GeoPackage.jl going then there is even the possibility of extracting the SQLite R-tree from there, which would be interesting. In any case, to my mind it makes sense to have some form of interface here - maybe the following on the implementor's side,

GO.trait(x)::GI.SpatialIndexTrait
GO.query(::GI.SpatialIndexTrait, x, extent)::Vector{Int}

Then, in GI,

GO.query(x, geom) = GI.query(GI.trait(x), GI.trait(geom), x, geom)
GO.query(::SpatialIndexTrait, ::AbstractGeometryTrait, x, geom) = GO.query(SpatialIndexTrait(), x, GI.extent(geom))
GO.query(::SpatialIndexTrait, ::Nothing, x, ext::Extent) = GO.query(SpatialIndexTrait(), x, ext)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions