code: add building exception if same as hse no

This commit is contained in:
Mark Joshwel 2023-06-03 10:41:51 +00:00
parent 0995ef91f3
commit aba11aee95

View file

@ -204,10 +204,18 @@ def surplus(
# location["address"].get("leisure"), # location["address"].get("leisure"),
# location["address"].get("shop"), # location["address"].get("shop"),
# location["address"].get("railway"), # location["address"].get("railway"),
location["address"].get("building"), (
location["address"].get("building")
if (
location["address"].get("building")
!= location["address"].get("house_number")
)
else None
),
location["address"].get("highway"), location["address"].get("highway"),
( (
location["address"].get("house_number", "") location["address"].get("house_number", "")
+ (" " + location["address"].get("house_name", "")).strip()
+ " " + " "
+ location["address"].get("road", "") + location["address"].get("road", "")
+ ( + (
@ -219,7 +227,16 @@ def surplus(
else "" else ""
) )
).strip(), ).strip(),
location["address"].get("neighbourhood", ""), (
",".join(
[
location["address"].get(detail, "")
for detail in (
"residential, neighbourhood, allotments, quarter"
).split(", ")
]
)
).strip(","),
location["address"].get("postcode"), location["address"].get("postcode"),
location["address"].get("country"), location["address"].get("country"),
] ]