/** * * Loads the pax file and does a nearest neighbor search to match the nearest geo record in time */ public void loadPax() { // Open pax file // for each line // create a PeopleRecord // match it to a Geo record try { CSVReader reader = new CSVReader(new FileReader(PAXFILE)); String[] nextLine; int lineCounter = 0; while ((nextLine = reader.readNext()) != null) { // nextLine[] is an array of values from the line if (lineCounter > 0) { int secSinceMidnight = Integer.parseInt(nextLine[8]); double[] key = new double[1]; key[0] = TIME_SHIFT + 1.0 * secSinceMidnight; GeoRecord matchingGeo = (GeoRecord) geoRecords.nearest(key); if (matchingGeo != null) { PeopleRecord pr = new PeopleRecord(nextLine); pr.setTimeShiftSeconds(TIME_SHIFT); matchingGeo.addPeopleRecord(pr); } else { System.err.println("Null Geo Returned!!"); } } lineCounter++; } } catch (Exception e) { System.err.println(e); } }