by mrweasel · 2y ago · 0 comments
I'm sure there is a "falsehoods programmers believe about addresses" somewhere.
Foo House
Townland
Large town somewhat nearby where the mail comes through but only tangentially near the actual house
County Bar
Where Townland is optional.There's a bank address in my town: PTSB Kennedy Road Navan Co Meath
Kennedy Road is about 2 blocks long with ~ 30 shop fronts, and there are numbers on all but one of them.
Not really optional in most cases if you're not actually in the "large town somewhat nearby". I would say the large town part is more optional.
You're not going to get post delivered to "Lakeview, Cavan, Co Cavan", but you should be ok with "Lakeview, Killeshandra, Co Cavan".
In Meath, there's a House address near Garlow Cross where it's Foo House, Johnstown, Co Meath, but Johnstown is 7km away or so.
For those who have not been near there -- It's karst topography with basket of eggs hills where the water table is above ground in many of the valleys.
But apparently that would make data analysis to complicated.
The address field names are fairly standardized[0] and Google has an open dataset (used by Chrome and Android) describing which countries need which fields[1].
I have an older PHP library[2] and a newer Go library[3] that build upon this, while crowdsourcing fixes (since Google hasn't updated their dataset in a while). The Go library allows me to serve all address formats and state lists in a single HTTP request, which can then power a very fast JS widget.
[0] Initially by the OASIS eXtensible Address Language (xAL) which trickled down into everything from maps to HTML5 autocomplete.
[1] https://chromium-i18n.appspot.com/ssl-address