Kdtree subset query

@rgommers 
#4260 was merged despite not having any commits inside... So I am reissuing a PR

This is a private function right? Should then start with underscore.