Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map postal code FSAs to city names #76

Closed
davesteinberg opened this issue Apr 23, 2021 · 1 comment · Fixed by #185
Closed

Map postal code FSAs to city names #76

davesteinberg opened this issue Apr 23, 2021 · 1 comment · Fixed by #185
Assignees
Labels

Comments

@davesteinberg
Copy link
Collaborator

FSAs (the first three digits of a postal code) aren't meaningful to most users. It would be helpful to show the name of the city where that FSA resides.

Canada Post has an API, but it's intended for looking up a specific address and it has a per-call cost.

Wikipedia has the data, but it's spread out over 18 pages of HTML. I don't see any raw data. I suppose it would be possible to scrape the pages and assemble the data ourselves.

I also found this by Googling. I don't know if it's actually free or if it's any good, and I didn't create an account to try downloading.

@davesteinberg
Copy link
Collaborator Author

@JamiesonRoberts Have you had much time to work on this? Any luck with it?

I've been a bit obsessed thinking about simple solutions for postal code lookups (for this issue and especially #92) since I delivered the auto-emailer stuff last weekend. I had another look around for other possible sources of data and, I think Wikipedia is our best bet for mapping FSAs to placenames. So, on Monday evening, I wrote a bit of code to scrape the Wikipedia articles, and now I have a nice JSON of 1,663 FSAs for all of Canada.

If you're happy with this approach, I could set about getting them into the database so that we can get placenames with a simple join in our story query.

@davesteinberg davesteinberg linked a pull request Jun 3, 2021 that will close this issue
My Covid Story automation moved this from In progress to Done Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

3 participants