by harrisonjackson · 5y ago · 0 comments
https://www.mapbox.com/place-search
I think "location text" is the part they are not parsing well.
The screenshots all over that page show someone entering a couple of letters and getting the resulting POI with address.
Unfortunately, we could not get reliable results using their web place search so maybe they just have better mobile sdks that are adding more filter data to the requests automatically ¯\_(ツ)_/¯
If you're sticking with Mapbox, you'd probably need to a two-step lookup to obtain some useful results.
1. If there's no street address, check the search string to see if there's a city, or city, state. Find the lng,lat of that to use as the proximity bias. If nothing exists, use the user's current location. (Maybe this is why the mobile SDK is better.)
2. Then add the proximity bias while searching for the POI
But just a heads up, even a simple city query can be problematic. From personal experience, "san jose" would return San Jose in Costa Rica, or San Jose City in the Philippines, and rarely San Jose, CA, US unless a user was to type all that.
Google definitely has better NLP to handle user search queries.
Pretty common to use Google to look up an entity (to either get address or full geocoding results) and then Mapbox to do the display though.