I am working on a problem where along with data points location, I also have information about the connectivity between points.(Think a graph of points, where an edge denotes some relationship)
My queries have to be optimized not just to find say 'Nearest Neighbors(NN)' or 'Reverse Nearest Neighbors(RNN)' but to find the points that satisfy NN/RNN along with the graph constraints.
It seems like I might need to modify the R-Tree index to store this additional information and perhaps even write a couple of my own routines to add some extra functionality.
Is there any way I can abstract the implementation of R-Tree by PostGIS and quickly extend it? Do I need to delve into the internals before I can get anything accomplished?