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

Use standardized official country codes #195

Closed
aoles opened this issue Jun 12, 2018 · 10 comments
Closed

Use standardized official country codes #195

aoles opened this issue Jun 12, 2018 · 10 comments

Comments

@aoles
Copy link
Member

aoles commented Jun 12, 2018

It would streamline certain workflows if the APIs could be queried using standardized country codes, such as ISO 3166-1 alpha-2 instead of the ORS-specific(?) numeric ids listed in https://github.com/GIScience/openrouteservice-docs#country-list.

This doesn't need to be a breaking change because ISO_3166-1 codes can be easily distinguished from the current numeric ids, so the API could allow either.

Note that ISO 3166-1 country codes are already used by Pelias gecoder.

@MichaelsJP
Copy link
Member

country_codes.csv.txt

@TimMcCauley
Copy link
Contributor

TimMcCauley commented Jun 13, 2018

Afaik there is a reason why we use our own, @rabidllama can you elaborate?

@rabidllama
Copy link
Contributor

the main reason was to do with storage space on the graph. It shouldn't be a big thing to change to use country codes, but it would increase the storage (currently it uses I believe 6 bytes, and using a two character country code to store would be 12 bytes per edge). Generally I think that the storage is much more optimised for numerics as then you can do bit shifting to shorten the amount of space needed (which currently hasn't been implemented). The numbers used are a bit arbitary and so yes, country codes would make it easier to understand and identify, but we need to consider whether we store the country codes on the graph itself or if we have a hybrid solution where the codes are mapped to numerical values.

@TimMcCauley
Copy link
Contributor

Thanks for explaining, considering this closed, we have plenty of other things to dig into

@rabidllama
Copy link
Contributor

I am reopening this now as we have resources to look into it.

@takb the api should still work with numbers when finished, but also allow the country codes.

@rabidllama rabidllama reopened this Jan 7, 2019
@rabidllama rabidllama assigned takb and unassigned MichaelsJP Jan 7, 2019
@aoles
Copy link
Member Author

aoles commented Jan 7, 2019

I am reopening this now as we have resources to look into it.

That's awesome news, thanks @takb for picking up on this! Are you going to implement ISO 3166-1 alpha-2 country codes, or some other standard?

@takb
Copy link
Contributor

takb commented Jan 7, 2019

I was thinking alpha-2 and maybe alpha-3 additionally

@nilsnolde
Copy link
Contributor

+1 for both

rabidllama pushed a commit that referenced this issue Jan 14, 2019
avoid_countries with ISO Alpha-2 and Alpha-3 codes (#195) (#390)
@takb
Copy link
Contributor

takb commented Jan 14, 2019

The code changes won't break anything, but also won't work until you also load the updated CSV file from the gitlab repo openrouteservice-infrastructure/core-deployment. The updated CSV file won't work unless PR 390 is pulled.

@takb takb closed this as completed Jan 14, 2019
TimMcCauley pushed a commit that referenced this issue Jan 16, 2019
avoid_countries with ISO Alpha-2 and Alpha-3 codes (#195) (#390)
@rabidllama
Copy link
Contributor

Will close this when it is put into the master branch

@rabidllama rabidllama reopened this Jan 21, 2019
@rabidllama rabidllama added this to the 5.0 milestone Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants