Skip to content

Commit

Permalink
Merge branch 'master' into python3.10-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
floptical committed Jul 5, 2024
2 parents 7402c7e + 5427a63 commit ca7dc75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 49 deletions.
49 changes: 0 additions & 49 deletions ais/engine/bin/make_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,55 +154,6 @@ def standardize_nulls(val):
else:
return None if val == 0 else val


def concatenate_dor_address(source_comps):
# Get attributes
address_low = source_comps[field_map['address_low']]
address_low_suffix = source_comps[field_map['address_low_suffix']]
address_high = source_comps[field_map['address_high']]
street_predir = source_comps[field_map['street_predir']]
street_name = source_comps[field_map['street_name']]
street_suffix = source_comps[field_map['street_suffix']]
street_postdir = source_comps[field_map['street_postdir']]
unit_num = source_comps[field_map['unit_num']]
source_address = None
street_full = ''
# Make street full
if street_name:
street_comps = [street_predir, street_name, street_suffix, \
street_postdir]
street_full = ' '.join([x for x in street_comps if x])

# Only accept numeric address_low_suffixes = 2 for transformation to 1/2; discard other numeric suffixes
address_low_fractional = None
try:
address_low_suffix_int = int(address_low_suffix)
if address_low_suffix_int == 2:
address_low_fractional = '1/2'
address_low_suffix = None
except:
pass

address_full = None
if address_low:
address_full = str(address_low)
if address_low_suffix:
address_full += address_low_suffix
if address_low_fractional:
address_full += ' ' + address_low_fractional
if address_high:
address_full += '-' + str(address_high)

# Get unit
unit_full = None
if standardize_nulls(unit_num):
unit_full = '# {}'.format(unit_num)

if address_full and street_full:
source_address_comps = [address_full, street_full, unit_full]
source_address = ' '.join([x for x in source_address_comps if x])

return source_address if source_address != None else ''
#############################################
# Read in files, format and write to tables #
#############################################
Expand Down
2 changes: 2 additions & 0 deletions ais/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,7 @@ def exclude_non_opa(self, should_exclude=True):
else:
return self


def get_all_parcel_geocode_locations(self, srid=DEFAULT_API_SRID, request=None):

geocode_xy_join = self \
Expand All @@ -1053,6 +1054,7 @@ def get_all_parcel_geocode_locations(self, srid=DEFAULT_API_SRID, request=None):
# return result of query without flag (set i=1 so all geocode_location flags are ignored)
return self.get_address_geoms(request=request, i=1)


def get_parcel_geocode_location(self, parcel_geocode_location=None, srid=DEFAULT_API_SRID, request=None):
if self.first():
# If request arg parcel_geocode_location is included (and if on_street arg is not),
Expand Down

0 comments on commit ca7dc75

Please sign in to comment.