If you already have the vector of points in memory why aren't you just using them as-is? Seems you are writing a file only to transform the data.