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

Reverse geocoding support for OpenStreetMap and LocationIQ geocoders #353

Open
jmourelos opened this issue Jun 7, 2018 · 4 comments
Open

Comments

@jmourelos
Copy link

First of all thanks for this awesome library.

I was trying to do some reverse geocoding with LocationIQ:
geocoder.locationiq([latitude, longitude], method='reverse', key='...')

But I am getting the following error:
Status code 404 from https://locationiq.org/v1/search.php: ERROR - 404 Client Error: Not Found for url: https://locationiq.org/v1/search.php?key=...

I looked into their documentation and they specified the following URL for reverse geocoding:
https://locationiq.org/v1/reverse.phpkey=YOUR_API_KEY&lat=LATITUDE&lon=LONGITUDE&format=json

At the same time as far as I understand they use internally OSM so I would expect the geocoder for both providers to show reverse geocoding, but it's missing in geocoder OSM documentation.

I am willing to contribute on this topic, but I would like to first clarify if there is a real problem or if it's me just not understanding something.

@jmourelos
Copy link
Author

jmourelos commented Jun 8, 2018

I have been debugging this and the problem seems to be in how the coordinates are parsed/transformed:

LocationIQReverse([52.52, 13.40]) gives a wrong result, looks like the query with the coordinates in the generated URL is malformed.

LocationIQReverse("52.52, 13.40") gives the right result.

@g-mc
Copy link

g-mc commented Jun 21, 2018

@jmourelos ,

I came across the same issue as you while trying to use reverse geocoding from LocationIQ, #359 is my attempt to fix it. I didn't look at the OpenStreetMap reverse geocoding yet but I will try to check it out now that I got the other one working.

@jmourelos
Copy link
Author

@g-mc ,

I thought initially that the "reverse.php" endpoint was LocationIQ specific, but I see now that it's a Nominatim endpoint. Checking their git history I see It's there at least since 2010.

That leads me to think that your solution should be applied also/to OSM, but probably that deserves a deeper look.

@g-mc
Copy link

g-mc commented Jun 21, 2018 via email

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

No branches or pull requests

2 participants