Preinitialize the spatial query
cleanup