Spatial index for 3D stellar catalogs