public void printCityRegionGroups() { db = MongoTools.connect("mongodb://localhost", "climaColombia"); var coll = db.GetCollection <StationGroup>("cityRegionGroups"); allRegionGroups = coll.Find(FilterDefinition <StationGroup> .Empty).ToList(); StreamWriter sw = new StreamWriter("regiongroups.csv"); foreach (StationGroup sg in allRegionGroups) { StringBuilder sb = new StringBuilder(); sb.Append(sg.name + ","); foreach (int code in sg.stationcodes) { sb.Append(code + ","); } sw.WriteLine(sb.ToString()); } sw.Close(); cities = MapTools.readCities(); stations = StationGrouping.getAllStationsFromDB(db); JSONout.writeGroup(allRegionGroups, @"C:\Users\Admin\Documents\projects\IAPP\climaColombiaOrg\tools\cityGroups\cityregiongroups.json", stations, cities); }
public void outputJSON() { JSONout.regionsToGEOJSON(regions); JSONout.writeGroup(stationsByRegion, @"C:\Users\Admin\Documents\projects\IAPP\piloto\webDev\tools\180707\regionalstations.json", stations, cities); JSONout.writeGroup(stationsByCity, @"C:\Users\Admin\Documents\projects\IAPP\piloto\webDev\tools\180707\citygroups.json", stations, cities); }