Datasets:
Download scripts/cleanup_aux_xml.py from paeslemesa/matchgeodem: direct link, hf CLI and curl.
- Browser
- Download file 872 Bytes
-
https://huggingface.co/datasets/paeslemesa/matchgeodem/resolve/main/scripts/cleanup_aux_xml.py
- Command line
-
hf download hf://datasets/paeslemesa/matchgeodem/scripts/cleanup_aux_xml.py
-
curl -L -o cleanup_aux_xml.py https://huggingface.co/datasets/paeslemesa/matchgeodem/resolve/main/scripts/cleanup_aux_xml.py
872 Bytes
| import os | |
| from pathlib import Path | |
| def remove_aux_xml_files(dataset_path): | |
| """Remove all QGIS-generated .aux.xml files from the dataset.""" | |
| dataset_path = Path(dataset_path) | |
| removed_count = 0 | |
| print("=" * 70) | |
| print("MatchGeo-DEM .aux.xml Cleanup") | |
| print("=" * 70) | |
| # Walk through all directories | |
| for root, dirs, files in os.walk(dataset_path): | |
| for file in files: | |
| if file.endswith('.aux.xml'): | |
| filepath = Path(root) / file | |
| print(f"🗑️ Removing: {filepath}") | |
| filepath.unlink() | |
| removed_count += 1 | |
| print(f"\n✅ Removed {removed_count} .aux.xml files") | |
| print("=" * 70) | |
| return removed_count | |
| if __name__ == "__main__": | |
| dataset_path = "/home/sabrina/Documents/Tese/05_Dataset/MatchGeo-DEM-v1/data" | |
| remove_aux_xml_files(dataset_path) | |