Closed DenisCarriere closed 7 years ago
I've got it working using the CLI & geocoder-geojson
library.
I simply dropped the postal code.
$ geocode -p mapbox "9 rue Alphonse Penaud Paris, France" --limit 1
It looks like it's a Mapbox issue, when I dropped the postal code it worked, I'm pretty sure it does the following:
Query: 9 rue Alphonse Penaud Paris, 75020 France
Mapbox's Forward & Reverse Geocoding API is very similiar.
http://api.tiles.mapbox.com/v3/{mapid}/geocode/{lon},{lat}.json
http://api.tiles.mapbox.com/v3/{mapid}/geocode/{query}.json
CC: @sbma44
Oh right ! Nice one. I did not thought about that.
That one is a strange one, I'm going to close this issue, but this doesn't fix the Mapbox provider issue.
Hey, belatedly: thanks for the bug report. I can replicate this issue and we'll be having a closer look.
@sbma44 Cool stuff! This behaviour looked a bit strange to me, I don't ping you very much. (don't mind my very fast reply, I had just refreshed my email box when you submitted your comment).
Hey @DenisCarriere, Thanks a ton for finding this bug! Happy to say I've tested and deployed a fix for this as of last night. The fix itself can be seen here: https://github.com/mapbox/carmen/pull/579
Feel free to ping us any time if you have any questions or run into any bugs!
Afterthought: It can take up to 48 hours for the query to clear out of our cache. If you add something like &cachebuster=1234
to the end of the query it will miss the cache, hitting the server with the fixed result.
Thanks ! I will use it back :)
@ingalls Thanks! 👍 The query works now, it's great that you've included the Paris, France
example in the Carmen test cases 😄
From @terry90
Hello Denis,
It's me again :) I do not want to open too much issues, so I'm gonna ask you by email. What is wrong with the mapbox provider ? I'm getting 422 errors claiming: {"message":"limit must be combined with a single type parameter when reverse geocoding"}%
But this is not the weird part, when I curl the exact same query by replacing "%20" with "\ " it works ! I tried to change the limit option, remove it etc.. the best I can get is a features: [], EMPTY ! It drives me mad haha.
Did you encountered this issue ?
Here are proofs:
curl 'https://api.mapbox.com/geocoding/v5/mapbox.places/9%20rue%20Alphonse%20Penaud%20Paris,%2075020%20France.json?access_token=YOURTOKEN&limit=1'
will return: ..."features":[]...
curl 'https://api.mapbox.com/geocoding/v5/mapbox.places/9%20rue%20Alphonse%20Penaud%20Paris,%2075020%20France.json?access_token=YOURTOKEN&limit=5'
will return: {"message":"limit must be combined with a single type parameter when reverse geocoding"}
curl 'https://api.mapbox.com/geocoding/v5/mapbox.places/9\ rue\ Alphonse\ Penaud\ Paris,\ 75020\ France.json?access_token=YOURTOKEN&limit=1'
will return a single result in features[], and the right one !!!
Have a good day !