It should be a pretty good basis for anyone else to use if they want to implement a SP-GiST index too.
I took a look at the code, and I feel myself a bit confused :)
It appears that you're indexing int8 values. That seems like unrealistic short representation for image signature.
Also, name of repository make me think that hamming distance would be used to compare signatures. But after look at the code, I see that plain absolute value of difference is used for that purpose.
For such notion of distance, you don't need a VP-tree or another complex indexing. B-tree is quite enough in this case. Alternatively, distance function is not what it meant to be.
It would be useful if you provide complete usage example of this extension: from image to signature conversion to search queries.
------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company