finds.dev

dhconnelly/rtreego

an R-Tree library for Go

View on GitHubHomepage ↗

★ 654GoBSD-3-Clauseupdated Dec 2024

// the take

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.

We read the README, the directory tree and a key source file in June 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
654
Forks
124
Language
Go
License
BSD-3-Clause
Last commit
20 Dec 2024

// nearby

If rtreego isn't quite it.

All repos →