Would incorporating this PR be useful to anyone? It was fully working but never merged. It seems a waste to not retain this functionality, and it could be a real benefit when dealing with very large tables with millions of points.
See akorotkov/pgsphere#8 and this comment.