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

Mapbox limit not working #8

Closed
DenisCarriere opened this issue Jan 19, 2017 · 9 comments
Closed

Mapbox limit not working #8

DenisCarriere opened this issue Jan 19, 2017 · 9 comments

Comments

@DenisCarriere
Copy link
Owner

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 !

@DenisCarriere
Copy link
Owner Author

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

  • Find 9 (thinks it's longitude)
  • Finds 75020 (thinks it's latitude since it's after a comma)

Mapbox's Forward & Reverse Geocoding API is very similiar.

Reverse

http://api.tiles.mapbox.com/v3/{mapid}/geocode/{lon},{lat}.json

Forward

http://api.tiles.mapbox.com/v3/{mapid}/geocode/{query}.json

CC: @sbma44

@terry90
Copy link

terry90 commented Jan 19, 2017

Oh right ! Nice one.
I did not thought about that.

@DenisCarriere
Copy link
Owner Author

That one is a strange one, I'm going to close this issue, but this doesn't fix the Mapbox provider issue.

@sbma44
Copy link

sbma44 commented Jan 23, 2017

Hey, belatedly: thanks for the bug report. I can replicate this issue and we'll be having a closer look.

@DenisCarriere
Copy link
Owner Author

@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).

@ingalls
Copy link

ingalls commented Jan 24, 2017

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!

@ingalls
Copy link

ingalls commented Jan 24, 2017

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.

@terry90
Copy link

terry90 commented Jan 24, 2017

Thanks ! I will use it back :)

@DenisCarriere
Copy link
Owner Author

@ingalls Thanks! 👍 The query works now, it's great that you've included the Paris, France example in the Carmen test cases 😄

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

4 participants