-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Store location OSM country code (e.g. FR) #292
Comments
good idea to store the country code, as Nominatim & Photon seem to have different 'country' formats. for the emoji, we already use something similar in the frontend : https://github.com/openfoodfacts/open-prices-frontend/blob/master/src/data/countries-with-emoji.json |
OSM's list of country codes, and their related name(s) : https://wiki.openstreetmap.org/wiki/Nominatim/Country_Codes |
Thank you @raphodn! Actually we already have a country referential based on ISO 3166-1 codes: https://github.com/openfoodfacts/openfoodfacts-dart/blob/master/lib/src/utils/country_helper.dart Regarding the flags, we may use a map like your
|
Problem
In "prices" locations, we have the country name (e.g.
'Italia'
), but we don't have the country code (e.g.'IT'
).That means that if we want to do something serious with the country data (and not just displaying the country name in some language), we need to maintain some kind of translation/code map.
Proposed solution
In OSM they provide the country code. We could store it in "prices" location.
Additional context
Very specific immediate use-case: displaying the country flag. It's very easy from the country code.
There are obviously more data-related use-cases, e.g. comparing prices among countries.
The text was updated successfully, but these errors were encountered: