private void writeWeather()

in bigtop-data-generators/bigtop-weatherman/src/main/java/org/apache/bigtop/datagenerators/weatherman/internal/Driver.java [143:167]


  private void writeWeather(Location location, List<WeatherRecord> trajectory)
          throws Exception {
    File outputFile = new File(outputDir.toString() + File.separator
            + location.getZipcode() + ".txt");
    Writer output = new BufferedWriter(new FileWriter(outputFile));

    output.write(
            "date,city,state,zipcode,temperature,windchill,windspeed,precipitation,rainfall,snowfall\n");
    for (WeatherRecord weather : trajectory) {
      String record = weather.getDate() + ",";
      record += location.getCity() + ",";
      record += location.getState() + ",";
      record += location.getZipcode() + ",";
      record += weather.getTemperature() + ",";
      record += weather.getWindChill() + ",";
      record += weather.getWindSpeed() + ",";
      record += weather.getPrecipitation() + ",";
      record += weather.getRainFall() + ",";
      record += weather.getSnowFall() + "\n";

      output.write(record);
    }

    output.close();
  }