* and coordinates in WGS84. Comments begin with a #.
*/
public static PointSet fromCsv(File filename) throws IOException {
/* First, scan through the file to count lines and check for errors. */
CsvReader reader = new CsvReader(filename.getAbsolutePath(), ',', Charset.forName("UTF8"));
reader.readHeaders();
int nCols = reader.getHeaderCount();
while (reader.readRecord()) {
if (reader.getColumnCount() != nCols) {
LOG.error("CSV record {} has the wrong number of fields.", reader.getCurrentRecord());
return null;