JaredOSM / vermont-address-import

1 stars 1 forks source link

Wrong addr:city for "Barre City" and "Barre Town" and similar #14

Open adamfranco opened 1 year ago

adamfranco commented 1 year ago

E911 has "TOWNNAME": "BARRE TOWN" and "TOWNNAME": "BARRE CITY", but neither of those are valid postal cities according to the postal cities according to the USPS which only recognizes BARRE. Screen Shot 2023-03-16 at 10 04 59 AM

In contrast, the USPS lookup tool does recognize both RUTLAND CITY and RUTLAND TOWN, but reduces both to a plain RUTLAND: Screen Shot 2023-03-16 at 10 05 57 AM Screen Shot 2023-03-16 at 10 06 44 AM

We could do a case statement to rewrite a few of these town names from the actual municipality to the USPS version. In addition to Barre & Rutland, what other town names would need to shift?

JaredOSM commented 1 year ago

Other cities that share a name or base name with a town worth checking: Essex Junction? (recently split out as separate city from Essex town) Newport St. Albans

adamfranco commented 1 year ago

As mentioned in https://github.com/JaredOSM/vermont-address-import/issues/15#issuecomment-1472504987 here are a few full-town postal-city renamings that probably make sense. This is not an exhaustive list. Read it as TOWN --> CITYGL. Some of these like the last 3-4 are simply USPS abbreviations on city names rather than actually different names.

"ADDRGL1" = "E911ADDR" AND "CITYGL" != "TOWN" AND "STGL" = 'VT' 
AND NOT ("TOWN" IN ('RUTLAND CITY', 'RUTLAND TOWN') AND "CITYGL" = 'RUTLAND' )
AND NOT ("TOWN" IN ('BARRE CITY', 'BARRE TOWN') AND "CITYGL" = 'BARRE')
AND NOT ("TOWN" IN ('SAINT ALBANS CITY', 'SAINT ALBANS TOWN') AND "CITYGL" = 'ST ALBANS')
AND NOT ("TOWN" IN ('ESSEX', 'ESSEX JUNCTION') AND "CITYGL" = 'ESSEX JCT')
AND NOT ("TOWN" = 'ROYALTON' AND "CITYGL" = 'SOUTH ROYALTON')
AND NOT ("TOWN" = 'HIGHGATE' AND "CITYGL" = 'HIGHGATE CENTER')
AND NOT ("TOWN" = 'MORRISTOWN' AND "CITYGL" = 'MORRISVILLE')
AND NOT ("TOWN" = 'ENOSBURGH' AND "CITYGL" = 'ENOSBURG FALLS')
AND NOT ("TOWN" = 'MONTGOMERY' AND "CITYGL" = 'MONTGOMERY CTR')
AND NOT ("TOWN" = 'LYNDON' AND "CITYGL" = 'LYNDONVILLE')
AND NOT ("TOWN" = 'NEWPORT TOWN' AND "CITYGL" IN ('NEWPORT CTR', 'NEWPORT CENTER'))
AND NOT ("TOWN" = 'NEWPORT CITY' AND "CITYGL" = 'NEWPORT')
AND NOT ("TOWN" = 'ISLE LA MOTTE' AND "CITYGL" = 'ISLE LAMOTTE')

AND NOT ("TOWN" = 'SAINT JOHNSBURY' AND "CITYGL" = 'ST JOHNSBURY')
AND NOT ("TOWN" = 'SOUTH BURLINGTON' AND "CITYGL" = 'S BURLINGTON')
AND NOT ("TOWN" = 'SOUTH HERO' AND "CITYGL" = 'SO HERO')

There are a few town like Hartford, Fletcher, and Ryegate that have a large variety of postal cities in their resident-owner addresses rather than using a uniform postal city.