DDF-348 - updated centroid function to find center when coordinates cross poles