public static Map<String,Integer> parseStopIdFromGtfs(String filename){
  Map<String,Integer> stopMap=new TreeMap<>();
  BufferedReader br=IOUtils.getBufferedReader(filename);
  try {
    String line=br.readLine();
    while ((line=br.readLine()) != null) {
      String[] sa=line.split(",");
      int stopId=Integer.parseInt(sa[5]);
      String stopName=sa[6];
      stopMap.put(stopName,stopId);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
    throw new RuntimeException("Cannot read from " + filename);
  }
 finally {
    try {
      br.close();
    }
 catch (    IOException e) {
      e.printStackTrace();
      throw new RuntimeException("Cannot close " + filename);
    }
  }
  return stopMap;
}

public static Map < String , Integer > parseStopIdFromGtfs ( String filename ) { Map < String , Integer > stopMap = new TreeMap < > ( ) ; BufferedReader br = IOUtils . getBufferedReader ( filename ) ; try { String line = br . readLine ( ) ; while ( ( line = br . readLine ( ) ) != null ) { String [ ] sa = line . split ( "," ) ; int stopId = Integer . parseInt ( sa [ 5 ] ) ; String stopName = sa [ 6 ] ; stopMap . put ( stopName , stopId ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( "Cannot read from " + filename ) ; } finally { try { br . close ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RuntimeException ( "Cannot close " + filename ) ; } } return stopMap ; }
parses the stops . txt file ( from a gtfs feed ) and builds a map linking stop names to the stop ids .
