I am trying to find a location that minimises the total distance to a series of points, and compare it with the distance to an existing location. I used the QGIS tool mean coordinate(s) to calculate the centroid and then calculated a distance matrix to the centroid and the existing location. I expected the sum of distances to the centroid to be shorter than the sum of distance to the existing location but this is not the case. I've tried with a WGS and a projected coordinate system (I guess results are only valid for the second) and in both cases the centroid did not minimise distance. Is my procedure flawed ?
The mean coordinate minimizes the sum of the square of the distance to each point, not the sum of the distances.
To illustrate why it is wrong to use the centroid, let's think that you have 2 points at the same location 0;0 and 1 point at 0;6. The average is 0;2 and the sum of the distances is 2+2+4=8. If you consider the best location as being 0;0, the sum of the distances becomes 0+0+6=6, which is better.