Closed missinglink closed 3 years ago
this looks great, nice that we already had this functionality
Makes sense. Realistically its probably easier to just list all the valid borough <-> zip code mappings than to try to detect any bad ones from OSM.
This PR attempts to enumerate all the
Queens County
ZIP codes and ensures that theborough
is correctly set.The motivation for this work is that ZIPs in Queens are often assigned either the incorrect
borough
or the incorrectlocality
, or both.I checked the replacement logic and confirmed that if the ZIP is found with a corresponding
borough
in the postal cities map, then thelocality
remains unchanged.https://github.com/pelias/wof-admin-lookup/blob/master/src/usePostalCity.js#L42
So this will fix any incorrect
borough
associations for these ZIPs and will simply leave thelocality
unmodified from what is returned from Point-in-polygon... I'm assuming that this is usually correct?I made a minor change to the TSV parser which allows adding comments, I know this isn't part of the standard TSV format but it's just nice to leave inline comments for things like this 🤷♂️
The ZIP code list was sourced from a website I found, it looked fairly exhaustive but I'm not a local, so maybe I missed some?