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
Convert What3Words Geocoder to the v2 API. #226
Conversation
Also remove the OneWord functionality that has been deprecated by What3Words.
Note: what3words API v1 will no longer be available after November 30. It would be good to get this merged before then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this is really good! I've left some minor notes. Also this needs to be rebased: tests in master already don't have one-word addresses.
verified. | ||
verified. As of API v2 only 'https' is supported - this parameter | ||
remains for backwards compatibility (setting to 'http' will stop | ||
this geocoder working). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to explicitly raise an exception in case http
is passed.
if scheme == "http":
raise ConfigurationError("What3Words doesn't support `http` scheme anymore. Please use `https` instead.")
|
||
if resources.get('error') == "11": | ||
if 'code' in resources['status']: | ||
raise exc.GeocoderQueryError( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please raise GeocoderAuthenticationFailure
here when resources['status']['code'] == 401
?
And the same for reverse
method below.
Merged in #303 |
Thanks for this! |
Yowsah! |
Also remove the OneWord functionality that has been deprecated by
What3Words.