Utility to write centroids for a class from a table