-
Notifications
You must be signed in to change notification settings - Fork 519
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 provider not working with US zip codes #1086
Comments
Hello @timwood , We don't do any process of the result. Do you mean that a query that's working on Mapbox API doesn't work using our Mapbox provider ? |
Hey @jbelien, |
Hi again @jbelien When manually querying the API (using the URL above), this results in the following response, which has no results: {
"type": "FeatureCollection",
"query": [
"20853"
],
"features": [],
"attribution": "NOTICE: © 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained. POI(s) provided by Foursquare."
} If the {
"type": "FeatureCollection",
"query": [
"20853"
],
"features": [
{
"id": "postcode.17761009594681230",
"type": "Feature",
"place_type": [
"postcode"
],
"relevance": 1,
"properties": {},
"text_en": "20853",
"place_name_en": "Rockville, Maryland 20853, United States",
"text": "20853",
"place_name": "Rockville, Maryland 20853, United States",
"bbox": [
-77.1307239780142,
39.0598630310048,
-77.072221997467,
39.1548479699547
],
"center": [
-77.08,
39.09
],
"geometry": {
"type": "Point",
"coordinates": [
-77.08,
39.09
]
},
"context": [
{
"id": "locality.5943981528969000",
"wikidata": "Q753733",
"text_en": "Aspen Hill",
"language_en": "en",
"text": "Aspen Hill",
"language": "en"
},
{
"id": "place.2385764576613990",
"wikidata": "Q327022",
"text_en": "Rockville",
"language_en": "en",
"text": "Rockville",
"language": "en"
},
{
"id": "district.14127387844028120",
"wikidata": "Q488659",
"text_en": "Montgomery County",
"language_en": "en",
"text": "Montgomery County",
"language": "en"
},
{
"id": "region.10710475061772660",
"wikidata": "Q1391",
"short_code": "US-MD",
"text_en": "Maryland",
"language_en": "en",
"text": "Maryland",
"language": "en"
},
{
"id": "country.19678805456372290",
"wikidata": "Q30",
"short_code": "us",
"text_en": "United States",
"language_en": "en",
"text": "United States",
"language": "en"
}
]
}
],
"attribution": "NOTICE: © 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained. POI(s) provided by Foursquare."
} Is the mapbox-provider able to account for different types queries against the mapbox API? If so, how does it determine which to use? |
Yes, it is indeed possible ! $query->withData('location_type', Mapbox::TYPE_POSTCODE) See |
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 forRockville, 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
The text was updated successfully, but these errors were encountered: