Most important thing is rtree
, which is like an N-dimensional binary tree, and allows for log(n) queries.
Also clone the library and look into the ton of examples that come with the source:
git clone https://github.com/boostorg/geometry