Skip to content

Expose the RTREE scalar index and GeoArrow spatial predicates in the Python and TypeScript SDKs, with docs #4554

Open

Description

@sarwarbhuiyan

Summary

Lance has shipped GeoArrow extension types (lance-format/lance#4678), an R-tree scalar index (lance-format/lance#5034, tracking epic lance-format/lance#5035) and ST_* functions through GeoDataFusion, as described in https://www.lancedb.com/blog/geo-support. Today that capability is reachable from pylance and from the LanceDB Rust SDK, but not from the LanceDB Python or TypeScript SDKs, and there is no geospatial page on docs.lancedb.com.

Current state (main, 2026-10-15)

  • pylance: ds.create_scalar_index("geom", "RTREE") and ds.sql("... WHERE ST_Intersects(geom, ST_GeomFromText('...'))") work (see python/python/tests/test_geo.py in lance-format/lance).
  • lancedb Rust: Index::RTree(RTreeIndexBuilder) exists behind the geo feature (rust/lancedb/src/index.rs, rust/lancedb/src/index/scalar.rs).
  • lancedb Python / TypeScript: a code search for RTREE / rtree returns no hits under python/ or nodejs/. Table.create_scalar_index does not accept an R-tree index type, and there is no documented way to use ST_* predicates in .where().
  • docs.lancedb.com: no page covers GeoArrow columns, spatial predicates or the R-tree.

Request

  1. Accept the R-tree in the Python SDK (index_type="RTREE" on create_scalar_index, or a dedicated config) and in the TypeScript SDK (Index.rtree() in createIndex).
  2. Document which ST_* predicates are accepted in where() filters, whether they run as a prefilter alongside vector search, and whether the R-tree accelerates them.
  3. Add a geospatial docs page: writing GeoArrow columns (e.g. from geoarrow.rust.core), creating the index, example queries combining ST_Intersects/ST_Within with vector search, and the "at most" candidate semantics of the R-tree with exact geometry verification by the engine.
  4. Clarify whether RemoteTable (LanceDB Cloud) supports the same index type and predicates.

Why

Users who combine vector search with polygon, corridor or distance filters (Earth observation, mapping, robotics logs with GPS) work from the Python and TypeScript SDKs rather than pylance or Rust. The Cloud-Native Geo embeddings sprint in March 2026 listed "supporting hybrid queries that combine spatial and vector search" as an open need in that community (https://cloudnativegeo.org/blog/2026/04/geo-embeddings-sprint-march-2026/). The format already does this; it only needs to be reachable from the higher-level SDKs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions