Closed Bug 1020378 Opened 10 years ago Closed 10 years ago

Store Country Codes as well as country names in the events platform

Categories

(Webmaker Graveyard :: Events, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: fuzzyfox, Assigned: fuzzyfox)

References

Details

(Whiteboard: [events] [sep19])

It would be super useful for stat generation, as well as de'duping data if we stored the country code along w/ the country in the events system.

The data for 99.99% of that can already be found in bug 1015512.

One instance where having the code over the name is useful would be the makerparty heatmap (bug 1010428) which can use country codes as IDs for each spot on the map, then use stats generated w/ those country codes.
We already store country names, which are unique identifiers that can be mapped to country codes. I'd recommend doing that otherwise we'll need to do a schema update, complete migration/geocoding of all existing event data, verification of that data integrity and refactor of the client and service to log codes for future events. IMO that is not worth the level of effort versus doing name-to-code mapping in whatever app is ingesting the API.

Suggesting: WONTFIX
So here is the interesting dataset I get from the API right now if I sort everything by country:

https://pastebin.mozilla.org/5345995

Looking at that, right now we still need to do the geocoding (which has been done by me already, see bug 1015512). The addition of country codes is also something that we get mostly for free don't we? Thats not only in the data I've provided in bug 1015512, but also something we can easily pull from the geocoding already happening to get the country. Just one more value to add?

As for the schema update thats something I can't speak to. Not looked into the DB for that one.
I'm in favour of doing it. The countries that we store now are user-entered data that could be in their own language; if we store the country codes, that's something machine readable.
Can we make a decision on this for the next release?
Whiteboard: [june27]
Whiteboard: [june27] → [events] [june27]
* Fuzzy: we'll need more info on this before pushing forward. Ping me in IRC so we can discuss.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(williamd)
Resolution: --- → WONTFIX
Whiteboard: [events] [june27] → [events] [july11]
* Fuzzy: is your events map now on live? Can you paste the link here?

* And also: clarify if you still want / need anything from us on this one
We should be storing something machine readable + standardized not just the country name.

Country names can vary based on location + even geocoders tend to return different names for the same place. However the Country Code is an ISO Standard and machine readable.

We can quite easily get this info for existing data due to having the lat-longs for events, and they are short strings (2 Chars). Much of the data is also already sat in bug 1015512 too.

Having this data in the events api will improve the accuracy of things like the MP Heatmap (http://makerparty-staging.herokuapp.com/live-updates) and make it easier to pump this data into other tools for stats generation, l10n of country names, etc...

---
ISO codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Status: RESOLVED → REOPENED
Flags: needinfo?(williamd)
Resolution: WONTFIX → ---
If you're going to do this, you'll need to update the front end code as well as the DB and service so that anytime a location is entered or updated the country code is persisted. This means at a minimum updating the event add and edit controllers.

I'd also suggest that if you are doing a complete DB update of all records that you check all the Event records to ensure integrity and accuracy. Anytime we modify every record we risk data corruption.

I don't see this as a priority for pre-Maker Party, but rather a nice-to-have. Fuzzy, if you have time and the means to put patches together feel free to do so.
Assignee: nobody → williamd
Whiteboard: [events] [july11] → [events] [july25]
* Still needed? We've been kicking this down the road for a while now -- Fuzzy, what do you think?
Flags: needinfo?(williamd)
Whiteboard: [events] [july25] → [events] [aug8]
Blocks: 1046689
Yes, still needed! I noticed that Japan was under-represented on the map due to the input address being written in Japanese (1046689).
* Sorry this one got buried Melissa -- going to mark wontfix. Please re-open if still needed.
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Flags: needinfo?(williamd)
Resolution: --- → WONTFIX
Whiteboard: [events] [aug8] → [events] [sep19]
This would be a more accurate map (very useful visual for recruiting contributors/funders) and a more useful marketing tool if we could get it right. Maybe next year.
You need to log in before you can comment on or make changes to this bug.