Ejemplo n.º 1
0
  public void loadGeo() {

    try {
      CSVReader reader = new CSVReader(new FileReader(GEOFILE));
      String[] nextLine;
      int lineCounter = 0;
      while ((nextLine = reader.readNext()) != null) {
        // nextLine[] is an array of values from the line
        if (lineCounter > 0) {
          GeoRecord newRecord = new GeoRecord(nextLine);
          double[] key = new double[1];

          // Keep track of trps
          int tripNumber = newRecord.getTripId();
          if (tripNumber > tripCounter) tripCounter = tripNumber;
          key[0] = newRecord.getSecondsSinceMidnight();

          // Key the time range
          if (key[0] < firstTime) firstTime = key[0];
          if (key[0] > lastTime) lastTime = key[0];

          System.err.println("trying sec " + newRecord.getSecondsSinceMidnight());
          geoRecords.insert(key, newRecord);
        }
        lineCounter++;
      }
    } catch (Exception e) {
      System.err.println(e);
    }
  }