def collect_results(iso3, sampling_areas):
    '\n\n    '
    sampling_areas = sampling_areas.to_crs('epsg:3857')
    output = []
    for (idx, sampling_area) in sampling_areas.iterrows():
        lon = sampling_area['geometry'].representative_point().coords[0][0]
        lat = sampling_area['geometry'].representative_point().coords[0][1]
        filename = '{}-{}'.format(lon, lat)
        directory = os.path.join(DATA_INTERMEDIATE, iso3, 'los_results')
        data = pd.read_csv(os.path.join(directory, (filename + '.csv')))
        seen = set()
        interval_size = 2500
        for distance_lower in range(0, 45000, interval_size):
            distance_upper = (distance_lower + interval_size)
            clos = 0
            nlos = 0
            for (idx, item) in data.iterrows():
                path_id = '{}_{}_{}'.format(item['point_id'], item['node_id'], item['distance'])
                if (not (path_id in seen)):
                    if (item['distance'] < distance_upper):
                        if (item['los'] == 'clos'):
                            clos += 1
                        elif (item['los'] == 'nlos'):
                            nlos += 1
                        else:
                            print('Did not recognize los')
                        seen.add(path_id)
            if (clos > 0):
                clos_probability = (clos / (clos + nlos))
            else:
                clos_probability = 'no data'
            if (nlos > 0):
                nlos_probability = (nlos / (clos + nlos))
            else:
                nlos_probability = 'no data'
            output.append({'decile': item['decile'], 'id_range_m': item['id_range_m'], 'distance_lower': distance_lower, 'distance_upper': distance_upper, 'total_samples': (clos + nlos), 'clos_probability': clos_probability, 'nlos_probability': nlos_probability})
    output = pd.DataFrame(output)
    folder = os.path.join(DATA_INTERMEDIATE, iso3)
    output.to_csv(os.path.join(folder, 'los_lookup.csv'), index=False)
def collect_results(iso3, sampling_areas):
    '\n\n    '
    sampling_areas = sampling_areas.to_crs('epsg:3857')
    output = []
    for (idx, sampling_area) in sampling_areas.iterrows():
        lon = sampling_area['geometry'].representative_point().coords[0][0]
        lat = sampling_area['geometry'].representative_point().coords[0][1]
        filename = '{}-{}'.format(lon, lat)
        directory = os.path.join(DATA_INTERMEDIATE, iso3, 'los_results')
        data = pd.read_csv(os.path.join(directory, (filename + '.csv')))
        seen = set()
        interval_size = 2500
        for distance_lower in range(0, 45000, interval_size):
            distance_upper = (distance_lower + interval_size)
            clos = 0
            nlos = 0
            for (idx, item) in data.iterrows():
                path_id = '{}_{}_{}'.format(item['point_id'], item['node_id'], item['distance'])
                if (not (path_id in seen)):
                    if (item['distance'] < distance_upper):
                        if (item['los'] == 'clos'):
                            clos += 1
                        elif (item['los'] == 'nlos'):
                            nlos += 1
                        else:
                            print('Did not recognize los')
                        seen.add(path_id)
            if (clos > 0):
                clos_probability = (clos / (clos + nlos))
            else:
                clos_probability = 'no data'
            if (nlos > 0):
                nlos_probability = (nlos / (clos + nlos))
            else:
                nlos_probability = 'no data'
            output.append({'decile': item['decile'], 'id_range_m': item['id_range_m'], 'distance_lower': distance_lower, 'distance_upper': distance_upper, 'total_samples': (clos + nlos), 'clos_probability': clos_probability, 'nlos_probability': nlos_probability})
    output = pd.DataFrame(output)
    folder = os.path.join(DATA_INTERMEDIATE, iso3)
    output.to_csv(os.path.join(folder, 'los_lookup.csv'), index=False)