Skip to content

Update LocationIQReverse - #359

Open
g-mc wants to merge 3 commits into
DenisCarriere:masterfrom
g-mc:locationiq_reverse
Open

Update LocationIQReverse#359
g-mc wants to merge 3 commits into
DenisCarriere:masterfrom
g-mc:locationiq_reverse

Conversation

@g-mc

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

Copy link
Copy Markdown

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