Skip to content

Commit

Permalink
Update preprocessing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobson committed May 10, 2024
1 parent 2700804 commit 384ad82
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions swmmanywhere/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 384ad82

Please sign in to comment.