Calculate the center of latitude and longitude coordinates
I'm looking for a elegant solution that calculates the center between several latitude-longitude coordinates (for example, to simply center a map to the center of a google-maps polygon). Table: locations : id | city | latitude | longitude ----------------------------------------------- 1 | Berlin | 52.524268 | 13.406290 ----------------------------------------------- 2 | London | 51.508129 | -0.1280050 ----------------------------------------------- 3 | Hamburg | 53.551084 | 9.9936817 ----------------------------------------------- 4 | Amsterdam | 52.370215 | 4.8951678 ------------------------