def generate_map(data_file, to_file, precision=PRECISION_ONE_METER): # title = 'GPS rows (as DBs) - 2014-06-25 - 22-05-34' title = FileUtils.get_file_name(data_file) map_data = pandas.read_csv(data_file) map_data.columns = ['gps', 'count'] generate_google_maps_html(map_data[:], to_file, title, precision=precision) # plot_map(map_data[:]) print 'Done.'
def files_base_name(): sumaries_file = opts['summaries'] to_folder = opts['to_folder'] use_basename = not opts['no_basename'] if to_folder is not None: base_name = to_folder if not base_name.endswith('/'): base_name += '/' else: base_name = '' if use_basename: base_name += FileUtils.get_file_name(sumaries_file).strip('.json').strip('.csv') + '_plot_' print 'Plots file base name: ', base_name return base_name
'--summaries=' + ETL_BASE + 'p27/_etl-profiler-summary-2014-11-14_19-56-45.csv' # '--profiler=' + ETL_BASE + 'p16_2014-08-26/h9gi-nx95_profiled.profiler' ] opts = process_args() if opts['summaries'] is not None: puts('===> Insight on Sumaries') insight_on_sumaries() generate_type_comparisson_with_metadata() title = 'map_dbs' data_file = opts['summaries'].replace('.csv', '_gps_dbs.csv') to_file = opts['to_folder'] + title +'.html' MapUtils.generate_map(data_file, to_file) title = 'map_rows' data_file = opts['summaries'].replace('.csv', '_gps_rows.csv') to_file = opts['to_folder'] + title +'.html' MapUtils.generate_map(data_file, to_file) if opts['profiler'] is not None: puts('===> Insight on Single Sumary') profiler_file_name = opts['profiler'] base_name = opts['to_folder'] or FileUtils.get_file_name(profiler_file_name).strip('.json').strip('.csv') sumary, text_profiler, numeric_profiler, geo_profiler = ProfilerUtils.read_profiler_file(profiler_file_name) insight_on_single_sumary(base_name, sumary, text_profiler, numeric_profiler, geo_profiler) print '\n\n> DONE: All files ploted'