use this tag when dealing with questions related to kNN(K-Nearest Neighbors) a spatial property.

What is the KNN (K-Nearest Neighbors) problem ?

Imagine a set of arbitrary geometries; which may well be, a very huge dataset containing some millions of features.

Now imagine that for whatever reason you are interested in quickly identifying all features within a close spatial proximity to an arbitrary location. This is the typical KNN problem.

Just few practical real world examples:

Suppose while using a smartphone app: your current geographic location is well known by the integrated GPS sensor, so you are simply expecting that the app will immediately tell where you are (and the exact location of) the nearest fuel stations (hotels, restaurants etc).

Suppose a zoological/ecological study: you know where are located the nesting areas of some rare water bird species, also the location of all rivers, lakes, ponds and marshlands in the area you are interested in.