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

Update LocationIQReverse #359

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

g-mc
Copy link

@g-mc g-mc commented Jun 21, 2018

Trying to use LocationIQ's reverse geocoding, I came across the same issue (partly) as mentioned in #353 . This PR updates LocationIQReverse to use their 'reverse.php' endpoint and also updates the test accordingly. I didn't look at the OpenStreetMap yet so it seems like this PR might only be fixing 50% of #353

Main changes:

  • Import Location to properly split given latitude/longitude
  • Modify _URL to use reverse endpoint instead
  • Modify _build_params for reverse endpoint
  • Modify _adapt_results to put single JSON response in a list
  • Modify coordinates in LocationIQReverse example (from unittest)

As I am new to this library, I'm not 100% sure if my modification of _adapt_results is the best way to achieve the correct response but it was raising errors without returning a single item list of json_response. If there is a better way, let me know and I will try to update this PR.

def _adapt_results(self, json_response):
    return [json_response]

g-mc added 3 commits June 20, 2018 18:24
  * Import `Location` to properly split given latitude/longitude
  * Modify `_URL` to use `reverse` endpoint instead
  * Modify `_build_params` for `reverse` endpoint
  * Modify `_adapt_results` to put single JSON response in a list
  * Modify coordinates in `LocationIQReverse` example (from unittest)
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.

1 participant