Spatial index, written in C++