by simpaticoder · 2y ago · 0 comments
This has also come up for me in two dimensions when dealing with overlapping rectangles. For some reason the complexity of it surprised me both times. Sadly computing these cases is a straight-forward slog in 1-D; you can however reuse the solution for higher dimensions in a nice way.
https://en.wikipedia.org/wiki/R-tree
e.g. PostGIS has GiST-RTree:
https://postgis.net/docs/manual-3.2/using_postgis_dbmanageme...