Given a stream of spatial coordinates, design an efficient data structure to query the nearest neighbors in real-time.