Skip to contents

**The online tiers always answer, and their wrong answers are confident.** NRCan's geolocator returns `1 Rue Notre-Dame Ouest, Montreal, QC` as an `INTERPOLATED_POSITION` on a real Rue Notre-Dame Ouest in Lorrainville, 500 km away, and `330 Spadina Rd, Toronto` as `330 Spadina Avenue`, a different street 3 km off. Neither is imprecision – both are answers to a different question, and no confidence field distinguishes them.

What separates them is that the answer is itself an address, so it can be put back into components and compared to the ones that were sent. That is the whole floor, and it is shared by every online tier: **the answer has to come back as the address that was asked for.** Where the components come from differs – [nar_nrcan_floors()] re-parses a returned title, [nar_osm_floors()] reads fields the service already separated – but what is done with them once they exist does not, and a second copy of these rules would drift from this one.

The comparison is per component rather than a single [address_key()] equality, because the components are not equally strict:

* `CIVIC_NO`, `STREET_NAME` – must be **present on both sides and equal**. These are what the query was about; a missing one means nothing was verified. * `STREET_TYPE`, `STREET_DIR`, `PROV_ABVN` – rejected only when both sides are present and **contradict**. An absent one cannot contradict anything. * `MUN_NAME` – whole-word containment either way, not equality. Both services return incorporated names, so `TORONTO` comes back as `City Of Toronto`, `NORTH VANCOUVER` as `District Of North Vancouver` and `CHARLOTTETOWN` as `City of Charlottetown`. Equality would reject all three.

Whole-word matters: comparing the municipality against the *whole* returned string with a plain substring test – the first thing tried – passes `28 Silver ST, CORNER BROOK` against `28 Brook Street, Corner Brook`, because `Brook` appears in the street name. Field-wise comparison is what catches it.

Usage

nar_address_agreement(q, t)

Arguments

q

Parsed components of the address that was sent

t

Parsed components of the answer that came back

Value

A character vector, `NA` where the answer agrees and otherwise a short reason naming the component that disagreed