private void btnMuban_Click(object sender, EventArgs e) { Int32 geocode = GetCurrentChangwat().Geocode; var mubanCsvReader = new MubanCSVReader(); var data = mubanCsvReader.Parse(geocode); if (data != null) { var form = new StringDisplayForm("Muban", mubanCsvReader.Information(data)); String outFilename = Path.Combine(GlobalSettings.XMLOutputDir, "Muban" + geocode.ToString() + ".kml"); data.ExportToKml(outFilename); form.Show(); } }
private void btnMubanNames_Click(object sender, EventArgs e) { List <EntityType> types = new List <EntityType>() { EntityType.Muban }; EntityCounter namesCounter = new EntityCounter(types); if (chkUseCsv.Checked) { var entityList = new List <PopulationDataEntry>(); var counter = new FrequencyCounter(); foreach (PopulationDataEntry entity in TambonHelper.ProvinceGeocodes) { if (entity.Geocode != 10) { var reader = new MubanCSVReader(); var data = reader.Parse(entity.Geocode); if (data != null) { MubanCSVReader.Statistics(data, counter); var flatData = data.FlatList(types); entityList.AddRange(flatData); } } } var formStatistics = new StringDisplayForm("Muban", MubanCSVReader.StatisticsText(counter)); formStatistics.Show(); namesCounter.Calculate(entityList); } else { namesCounter.Calculate(); } var formNames = new StringDisplayForm("Muban", namesCounter.CommonNames(20)); formNames.Show(); }
private void btnMuban_Click(object sender, EventArgs e) { Int32 geocode = GetCurrentChangwat().Geocode; var mubanCsvReader = new MubanCSVReader(); var data = mubanCsvReader.Parse(geocode); if ( data != null ) { var form = new StringDisplayForm("Muban", mubanCsvReader.Information(data)); String outFilename = Path.Combine(GlobalSettings.XMLOutputDir, "Muban" + geocode.ToString() + ".kml"); data.ExportToKml(outFilename); form.Show(); } }
private void btnMubanNames_Click(object sender, EventArgs e) { List<EntityType> types = new List<EntityType>() { EntityType.Muban }; EntityCounter namesCounter = new EntityCounter(types); if ( chkUseCsv.Checked ) { var entityList = new List<PopulationDataEntry>(); var counter = new FrequencyCounter(); foreach ( PopulationDataEntry entity in TambonHelper.ProvinceGeocodes ) { if ( entity.Geocode != 10 ) { var reader = new MubanCSVReader(); var data = reader.Parse(entity.Geocode); if ( data != null ) { MubanCSVReader.Statistics(data, counter); var flatData = data.FlatList(types); entityList.AddRange(flatData); } } } var formStatistics = new StringDisplayForm("Muban", MubanCSVReader.StatisticsText(counter)); formStatistics.Show(); namesCounter.Calculate(entityList); } else { namesCounter.Calculate(); } var formNames = new StringDisplayForm("Muban", namesCounter.CommonNames(20)); formNames.Show(); }