geocoder-php / geocoder-php/Geocoder

Mapbox provider not working with US zip codes

Open
#1,086 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
PHP
Stars
4k
Forks
525
Avg merge
8m
Merged PRs (30d)
1

Description

When using the https://github.com/geocoder-php/mapbox-provider with Drupal's geocoder module, Mapbox is unable to geocode US zip codes. I've tried both +5 and +9 zip codes. Mapbox also seems to have issues with searching for example Rockville, MD (get results in New England 🤷‍♂️ ) yet searching for Rockville, Maryland gets the expected results. When using more complete addresses, geocoding works.

When using the ArcGis Online provider, the above examples work flawlessly.

The Mapbox geocoder format guide suggests that US zip code (either five or nine digit) should work: https://docs.mapbox.com/help/troubleshooting/address-geocoding-format-guide/#zip-code-formatting

Has anyone else experienced similar problems with the Mapbox provider?

Related issue on D.O. https://www.drupal.org/project/geocoder/issues/3176070

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported US ZIP-code and abbreviated city/state queries against the Mapbox provider, then compare their results with ArcGis Online and the linked Mapbox geocoding format guide. Done means the documented ZIP formats and examples return the expected locations, with the provider behavior or limitation clearly established.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.