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 location search is splitting apartment addresses on the '#' and using second half as URL anchor #437

Open
omnilord opened this issue Feb 24, 2021 · 0 comments

Comments

@omnilord
Copy link

The mapbox module does a self.url.format(location) to generate the base URL instead of properly encoding the URL. This results in apartment addresses being split at the '#' symbol for the apartment number, and the access token being injected in the middle of the address instead of after the '.json' extension.

Example:

g = geocoder.mapbox('1300 Foulk Rd, #8, Wilmington, DE 19803')

Status code 404 from https://api.mapbox.com/geocoding/v5/mapbox.places/1300 Foulk Rd, #8, Wilmington, DE 19803.json: ERROR - 404 Client Error: Not Found for url:
https://api.mapbox.com/geocoding/v5/mapbox.places/1300%20Foulk%20Rd,%20?access_token=<token>#8,%20Wilmington,%20DE%2019803.json

Using an alternate module such as google works fine, but that may not be an option for some projects.

python - 3.9.1
geocoder - 1.38.1

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

1 participant