From dfe48da577ce62b59ddfc71dd330c836c5f33534 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Fri, 18 Mar 2022 11:08:33 +0000 Subject: [PATCH] tidy script --- etl/filter_mastermap.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/etl/filter_mastermap.py b/etl/filter_mastermap.py index e291c7ad..af27a21c 100644 --- a/etl/filter_mastermap.py +++ b/etl/filter_mastermap.py @@ -14,27 +14,11 @@ csv.field_size_limit(sys.maxsize) def main(mastermap_path): mm_paths = sorted(glob.glob(os.path.join(mastermap_path, "*.gml.csv"))) - # toid_paths = sorted(glob.glob(os.path.join(ab_path, "ab_toids_*.txt"))) - - # try: - # assert len(mm_paths) == len(toid_paths) - # except AssertionError: - # print(mm_paths) - # print(toid_paths) - # zipped_paths = zip(mm_paths, toid_paths) - - # parallel map over tiles - # with Pool() as p: - # p.starmap(filter, zipped_paths) - for mm_path in mm_paths: filter(mm_path) -def filter(mm_path): - # with open(toid_path, 'r') as fh: - # r = csv.reader(fh) - # toids = set(line[0] for line in r) +def filter(mm_path) output_path = "{}.filtered.csv".format(str(mm_path).replace(".gml.csv", "")) alt_output_path = "{}.filtered_not_building.csv".format(str(mm_path).replace(".gml.csv", "")) output_fieldnames = ('WKT', 'fid', 'descriptiveGroup') @@ -50,10 +34,6 @@ def filter(mm_path): if 'Building' in line['descriptiveGroup']: w.writerow(line) - # elif line['fid'] in toids: - # alt_w.writerow(line) - - if __name__ == '__main__': if len(sys.argv) != 2: