Skip to content

Commit

Permalink
Removed OSM underground floors from nstories count for better results
Browse files Browse the repository at this point in the history
  • Loading branch information
bacetiner committed Mar 31, 2024
1 parent 3b37512 commit 179374f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions brails/workflow/FootprintHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# Barbaros Cetiner
#
# Last updated:
# 03-29-2024
# 03-30-2024

import math
import json
Expand All @@ -54,6 +54,11 @@
import concurrent.futures
from requests.adapters import HTTPAdapter, Retry
import unicodedata
import warnings

# Set a custom warning message format:
warnings.formatwarning = lambda message, category, filename, lineno, line=None: \
f"{category.__name__}: {message}\n"

class FootprintHandler:
def __init__(self):
Expand Down Expand Up @@ -287,8 +292,7 @@ def height2float(inpstr,lengthUnit):
'height':'buildingheight',
}

levelkeys = {'building:levels','roof:levels',
'building:levels:underground'}
levelkeys = {'building:levels','roof:levels'} # Excluding 'building:levels:underground'
otherattrkeys = set(attrmap.keys())
datakeys = levelkeys.union(otherattrkeys)

Expand Down Expand Up @@ -1021,7 +1025,8 @@ def fp_source_selector(self):
elif self.fpSource=='usastr':
footprints, attributes = get_usastruct_footprints(self.queryarea,lengthUnit)
else:
print('Unimplemented footprint source. Setting footprint source to OSM')
warnings.warn('Unimplemented footprint source. Setting footprint source to OSM',
UserWarning)
footprints, attributes = get_osm_footprints(self.queryarea,lengthUnit)
return footprints, attributes

Expand Down

0 comments on commit 179374f

Please sign in to comment.