Closed mraross closed 5 years ago
Darrin did an overlay of the ITN roads against the EA polygons. 2314 addressed segments (~0.5% of all segments) cross a boundary edge. Many of these cases are just tiny overshoots where the two datasets don't quite align. Others are from misalignment of ITN & EA, e.g. down the centreline of a double line road.
The recommendation for our initial allocation approach is to calculate a 2m offset left/right from the midpoint of each line, then overlay these points on the EA polygons. Any short overshoot cases will be correctly allocated using this approach and it should give us a pretty good result. The 2m allows wiggle room for slight misalignments in the base datasets.
No matter what approach we use, there will be a few cases that get incorrectly assigned. That would hold true even if we went to the next level of complexity and did an overlay of each site/access point. Unless the EAs are warped so that they perfectly align with ITN, there will always be a small number of edge cases that cannot be modeled correctly through any automated approach.
Added support for left_electoral_area_id and right_electoral_area_id which refer to a separate file of electoral area ids and names. A field named "electoralArea" is added to the various output formats. Note that NCAPs will not have electoral areas, as they are not attached to a segment, and intersections will not have electoral areas as it doesn't seem relevant.
Tested locally on all output formats. An address in an electoral area is 2871 HWY 20 HAGENSBORG BC
Confirmed in Delivery. eg. https://geocoderdlv.api.gov.bc.ca/addresses.html?addressString=2873%20HWY%2020%20HAGENSBORG%20BC
Confirmed in prod
Verified in test.
Add electoral area properties to all geocoder responses. Note that fullAddress does not change. If an address is not located in a municipality, electoralArea should contain the name of the regional district and electoral area the address is located in; otherwise, electoralArea should be empty.
Electoral area is the civic authority for a locality that are not located in a municipality.