encode spatial proximity. Is there an API (backend C-level is fine) to access a GIST index?
The best way is to extend existing interface to GiST to support KNN-search. But you can see how to get access to index structure from module in gevel module (http://www.sigaev.ru/cvsweb/cvsweb.cgi/gevel/). GiST-related functions in this module is invented to help to developers, not for production use, so they acquire exclusive lock on index.
-- Teodor Sigaev E-mail: teodor@xxxxxxxxx WWW: http://www.sigaev.ru/