[postgis-users] Adaptive k-nearest neigbourh in PostGIS

Giuseppe Broccolo g.broccolo.7 at gmail.com
Mon Jan 8 07:48:19 PST 2018

Hi Vilem,

2018-01-08 16:26 GMT+01:00 Vilem Ded <Ded.V at seznam.cz>:

> Thanks,
> very nice indeed! I will definitely give that a try.
> But this is really very dependent on data distribution. My dataset is
> clustered so it will be better, but probably not good enough:/
> As I understood KNN in Postgis is implemented with priority queue?
> If so, there must be condition of type while i < k {next} , where k is our
> K in KNN. I was hoping for some way how to alter this part of code - "just"
> change those few lines..

Yes, kNN in PostgreSQL is based on pairing heap algorithm, that provides a
priority queue of index nodes at some point. Consider that kNN is supported
in GiST indexing more in general - i.e., it is not just a part of PostGIS.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20180108/45a9008d/attachment.html>

More information about the postgis-users mailing list