pelias / wof-admin-lookup

Who's on First Admin Lookup for the Pelias Geocoder
https://pelias.io
MIT License
9 stars 24 forks source link

add Queens ZIP codes to USA postal cities override file #301

Closed missinglink closed 3 years ago

missinglink commented 3 years ago

This PR attempts to enumerate all the Queens County ZIP codes and ensures that the borough is correctly set.

The motivation for this work is that ZIPs in Queens are often assigned either the incorrect borough or the incorrect locality, 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 the locality 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 the locality 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?

blackmad commented 3 years ago

this looks great, nice that we already had this functionality

orangejulius commented 3 years ago

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.