// the find
dhconnelly/rtreego
an R-Tree library for Go
A pure Go R-tree implementation supporting N-dimensional bounding-box and k-nearest-neighbor queries. It's a solid algorithmic primitive for anyone building spatial indexes or geospatial tooling in Go without wanting to pull in a full database. Single maintainer, ~650 stars, small and stable.
Handles arbitrary N dimensions, not just 2D or 3D — useful for embedding-space nearest-neighbor searches beyond geography. The `Spatial` interface is minimal and easy to implement: just return a `*Rect`. Both intersection search and KNN are covered, which is the core 80% of spatial query needs. CI is still running and last commit was late 2024, so it's not abandoned.
No bulk-update support — modifying an object's position requires delete + re-insert, and if you forget, the tree silently corrupts (the README warns you, but that's a footgun). No R*-tree split strategy by default despite citing the Beckmann paper; the rebalancing is heuristic and performance degrades under adversarial insert patterns. Zero concurrency safety — concurrent reads/writes need external locking, which the docs don't mention. The whole library is three files, so there's no escape hatch if you need custom distance metrics or on-disk persistence.