Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix opencage country parameter#342

Merged
KostyaEsmukov merged 5 commits intogeopy:masterfrom
illing2005:master
Jan 8, 2019
Merged

Fix opencage country parameter#342
KostyaEsmukov merged 5 commits intogeopy:masterfrom
illing2005:master

Conversation

@illing2005
Copy link
Contributor

fixes #341

Copy link
Member

@KostyaEsmukov KostyaEsmukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@@ -116,8 +116,8 @@ def geocode(
:param str country: Provides the geocoder with a hint to the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the docs at https://opencagedata.com/api#forward-opt, the countrycode param restricts the results to the specified country, however the current description there says that it just provides a hint. Could you please update this description?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I changed that.

Copy link
Member

@KostyaEsmukov KostyaEsmukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Merging 😊

geocoder but will not restrict the possible results to the
supplied country. The country code is a 3 character code as
defined by the ISO 3166-1 Alpha 3 standard.
:param str country: Restricts the results to the specified country or countries.
Copy link
Member

@KostyaEsmukov KostyaEsmukov Jan 8, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear how one could specify multiple countries. Should it be a comma- or a space-separated list, or should it be a python list of strings?

I suppose this is not a single occurrence of such an ambiguity in geopy, so I'll address that for all geocoders later. To keep things "pythonic", it should accept a list of strings instead of a single comma-separated string (as specified in their docs at https://opencagedata.com/api#forward-opt).

@illing2005
Copy link
Contributor Author

Thanks for merging!
Do you already know when there will be a new release?

@KostyaEsmukov
Copy link
Member

TBH I didn't think of that yet. I'll try to get to it next week.

In the meantime you may want to consider installing from the master branch directly:

pip install --upgrade https://github.com/geopy/geopy/archive/master.zip

@KostyaEsmukov
Copy link
Member

I've just released 1.19.0 which contains this fix.

Apologies for the delay!

@illing2005
Copy link
Contributor Author

Great! Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opencage: country option in forward geocoding not working

2 participants

Comments