diff --git a/src/pipeline_steps.py b/src/pipeline_steps.py index 80a3120..cb6fcd1 100644 --- a/src/pipeline_steps.py +++ b/src/pipeline_steps.py @@ -267,7 +267,7 @@ def save_output(data_id, map_data: CMAAS_Map, output_dir, feedback_dir, output_t continue feature_mask = np.zeros_like(map_data.poly_segmentation_mask, dtype=np.uint8) feature_mask[map_data.poly_segmentation_mask == legend_index] = 1 - filepath = os.path.join(output_dir, sanitize_filename(f'{map_data.name}_{feature.label}.tif')) + filepath = os.path.join(output_dir, sanitize_filename(f'{map_data.name}_{feature.label}_{feature.type}.tif')) io.saveGeoTiff(filepath, feature_mask, map_data.georef.crs, map_data.georef.transform) legend_index += 1 return map_data.name diff --git a/src/utils.py b/src/utils.py index 994708e..7f8d76d 100644 --- a/src/utils.py +++ b/src/utils.py @@ -102,4 +102,4 @@ def boundingBox(array): return [min_xy, max_xy] def sanitize_filename(filename, repl='□'): - return re.sub('[^0-9a-zA-Z _-]+', repl, filename).strip().replace(' ', '_') + return re.sub('[^0-9a-zA-Z ._-]+', repl, filename).strip().replace(' ', '_')