mapbox / mapbox-search-ios

Search SDK for iOS with preconfigured UI in Swift
https://docs.mapbox.com/ios/search/guides/
Other
15 stars 20 forks source link

Mapbox Search iOS is returning wrong coordinates for two addresses in New York City #120

Closed szewah closed 1 year ago

szewah commented 1 year ago

There's an issue with the coordinates for two addresses in New York City. I am asking here because the issues I raised via Mapbox forms hasn't been answered. At all. I sent it over a month ago.

The two locations are:

1. Fairway Market at 2131 Broadway, New York City. Your coordinates are CLLocationCoordinate2D(latitude: 40.78059768676758, longitude: -73.98127746582031)

It returns this, a location opposite Fairways Market, at the Beacon Theater.

Fairway

Open Street Maps coordinates are correct.

Mapbox playground coordinates are correct.

2. A Tempo at 290 Columbus Ave, New York City

Your coordinates: CLLocationCoordinate2D(latitude: 40.778621673583984, longitude: -73.97816467285156)

It returns this, a location south of the address.

A Tempo

Open Street Maps is correct.

Mapbox playground doesn't even bring it up.

What I'm using:

iOS: Ventura 13.4 Mapbox Search iOS: v1.0.0-rc.4 Mapbox Maps: 10.13.1

The piece of code I'm using to query:

func resultResolved(result: SearchResult, searchEngine: SearchEngine) {
           let annotation = CLLocationCoordinate2D(latitude: result.coordinate.latitude, longitude: 
          result.coordinate.longitude)
          print(annotation)
}

What's happening here?

kalbaxa commented 1 year ago

thanks for posting!

@kried @sarochych can we investigate the difference with the playground?

kried commented 1 year ago

Hi @szewah

It looks like you've been using the raw SearchEngine As a general rule, we recommend using PlaceAutocomplete API to find a POI. Please, check our demo app to test the requests.


I checked the response in the SDK for the provided examples. Both of them seem correct. Please share the request and code example so we can check the request options.

  1. For the first query "Fairway Mar", PlaceAutocomplete returns the result with CLLocationCoordinate2D(latitude : 40.7808461, longitude : -73.9817346) and the routable point for navigation CLLocationCoordinate2D(latitude : 40.78075476035471, longitude : -73.98159278446235).
  1. For the second request, Mapbox playground returns the result for the "A Tempo" query if the proximity or bbox are provided. "A Tempo" is quite a general query, in order to find the specific POI you should limit the search area

The SDK returns the result with CLLocationCoordinate2D(latitude : 40.778978, longitude : -73.978117) and the routable point for navigation CLLocationCoordinate2D(latitude : 40.778765137546486, longitude : -73.9778402788104).

Playground
szewah commented 1 year ago

Thanks! Let me take a look and respond to you by tomorrow (Fri 16).

szewah commented 1 year ago

Wanted to check - is Place Autofill still in private preview mode? I'm looking at the pricing page and there isn't any information on it. Thanks.

kalbaxa commented 1 year ago

@szewah Address Autofill is publicly available and its pricing is here: https://www.mapbox.com/pricing/#autofill-session

szewah commented 1 year ago

So I'll use the address autofill in place of PlaceAutocomplete as per the above example. That should be okay for POI as well. Okay, I'll give it a go.

kalbaxa commented 1 year ago

@szewah Address Autofill has different purpose (filling in the address components) and will not provide best POI results.

If you need Place Autocomplete as per example use case in our docs, you can use it without contacting sales. We will update the docs soon. It will definitely have better POIs.

szewah commented 1 year ago

Thanks!

szewah commented 1 year ago

@kried I'm using PlaceAutocomplete and the coordinates for the two locations raised in the question are returning correct. Thanks.