From 384ad82261a63457cf0a5604965bb8c550827b18 Mon Sep 17 00:00:00 2001 From: Dobson Date: Fri, 10 May 2024 13:44:12 +0100 Subject: [PATCH] Update preprocessing.py --- swmmanywhere/preprocessing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/swmmanywhere/preprocessing.py b/swmmanywhere/preprocessing.py index da8d36c0..3bbcc596 100644 --- a/swmmanywhere/preprocessing.py +++ b/swmmanywhere/preprocessing.py @@ -244,9 +244,12 @@ def prepare_street(bbox: tuple[float, float, float, float], if addresses.street.exists(): return logger.info(f'downloading network to {addresses.street}') - if network_types[-1] != 'drive': + if 'drive' in network_types and network_types[-1] != 'drive': logger.warning("""The last network type should be `drive` to retain - `lanes` attribute, needed to calculate impervious area.""") + `lanes` attribute, needed to calculate impervious area. + Moving it to the last position.""") + network_types.pop("drive") + network_types.append("drive") networks = [] for network_type in network_types: network = prepare_data.download_street(bbox, network_type=network_type)