Closed bertday closed 7 years ago
Mocked up API response with path-like match_type
:
https://gist.github.com/rbrtmrtn/88c07f22d4e46e3d68c08621efd0d172
For step 1, we should make sure:
Query to select in range
address links missing children:
select * from
(select
a.street_address,
a.address_low,
a.address_high,
(a.address_high - a.address_low) / 2 + 1 as expected,
al.count as actual,
(al.count = (ceil((a.address_high - a.address_low) / 2) + 1)) as enough,
((a.address_high - a.address_low) / 2 + 1) - al.count as missing
from address a
join (select address_2, count(*) from address_link where relationship = 'in range' group by address_2) al
on a.street_address = al.address_2
) b
where b.enough = false
order by b.missing desc
Currently the
address_link
table is only being used to 1) return thematch_type
in the API and 2) to do some merging of unit siblings inmake_address_summary
. Using it more robustly in both the engine and the API could resolve a few open issues around address matching and attribute assignment (see #2, #6, #7, #9, #74).Objectives
009S190092
from 621-25 REED ST via path621 REED ST APT 2R has_base 621 REED ST in_range 621-25 REED ST
.777247710
from 921-39 E LYCOMING ST via path921-29 E LYCOMING ST overlaps 921-39 E LYCOMING ST
.009S190092
from 621-25 REED ST via path621 REED ST APT 2000 has_base 621 REED ST in_range 621-25 REED ST
.Project Outline
address_link
duringload_addresses
. Add any that are missing.overlaps
for ranges that intersect, e.g. 1708-10 and 1708-14.linked_address
andlinked_path
fields toaddress_tag
table.traverse_links
to tag fields inconfig.py
to designate if they should be inherited from parents or not.make_linked_tags
to calculate and store linked tag values.address_tag
values instead ofaddress_summary
.address_property
andaddress_parcel
tables.