Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This problem came up for me when writing a tool to help an author index his work. He wanted to be able to enter reference ranges for a term and then combine, including disjoint ones, into a single entry. (There was also a roman numeral problem irrelevant here).

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.



Most spatial databases use the R-Tree or one of its variants:

https://en.wikipedia.org/wiki/R-tree

e.g. PostGIS has GiST-RTree:

https://postgis.net/docs/manual-3.2/using_postgis_dbmanageme...




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: