Skip to content

Commit

Permalink
Sort address_streets before matching to avoid multiple segs due to hi…
Browse files Browse the repository at this point in the history
…gh range matching first
  • Loading branch information
Alexander-M-Waldman committed Apr 16, 2024
1 parent 0c26682 commit 5427a63
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ais/engine/scripts/load_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@
WRITE_OUT = True

DEV = False # This will target a single address
DEV_ADDRESS = '5601 E WISTER ST'
DEV_ADDRESS = "920-22 W GIRARD AVE"
DEV_ADDRESS_COMPS = {
# 'address_low': '5601',
# # 'address_high': '',
# 'street_predir': 'E',
# 'street_name': 'WISTER',
# 'street_suffix': 'ST',
# 'base_address': '1 FRANKLIN TOWN BLVD',
# 'address_high': '4726',
# 'street_name': 'ALDEN',
# 'street_suffix': 'WALK',
}
DEV_STREET_NAME = 'WISTER'
DEV_STREET_NAME = 'W GIRARD AVE'

# Logging stuff.
address_errors = []
Expand Down Expand Up @@ -710,7 +709,7 @@ def had_street_error(street_address, reason, notes=None):
'right_to'
]
seg_map = {}
seg_rows = street_segment_table.read(fields=seg_fields)
seg_rows = street_segment_table.read(fields=seg_fields, sort=['STREET_FULL', 'LEFT_FROM', 'RIGHT_FROM'])
for seg_row in seg_rows:
street_full = seg_row['street_full']
street_full_segs = seg_map.setdefault(street_full, [])
Expand Down

0 comments on commit 5427a63

Please sign in to comment.