How to calculate the average position of a series of (X, Y) value groups in postgresql.