POI Details

VERSION 0.2.2257
PUBLIC PREVIEW

Use POI details search to obtain the information about a point of interest.

To perform a call, you need to obtain a unique POI identifier and then use it to create a POIDetailsQuery.

To obtain a unique POI identifier you could use fuzzy search with resultTypeSet set to poi.

You can request POI details in different languages. See the list of supported languages.

Specify the desired response language when creating a POIDetailsQuery using a locale parameter.

If no language is specified, categories will be returned in English.

1let amsterdamCenter = CLLocationCoordinate2D(latitude: 52.377956, longitude: 4.897070)
2let poiQuery = SearchQuery(
3 "Restaurant",
4 geoBias: amsterdamCenter,
5 resultTypeSet: [.poi]
6)
7searchService.search(query: poiQuery) { [weak searchService] result in
8 switch result {
9 case let .success(poiSearchResponse):
10 let result = poiSearchResponse.results.first.flatMap { try? POIID(from: $0.id) }
11 let query = POIDetailsQuery(
12 poiID: result!,
13 locale: Locale(identifier: "en_GB")
14 )
15
16 searchService?.requestPOIDetails(query: query) { result in
17 switch result {
18 case let .success(poiDetailsResponse):
19 // handle success
20 break
21 case let .failure(error):
22 // handle error
23 break
24 }
25 }
26
27 case let .failure(error):
28 // handle error
29 break
30 }
31}

As a result, you will get a POIDetailsResponse that contains SearchResult with updated poi property - https://developer.tomtom.com/assets/downloads/tomtom-sdks/ios/api-reference/0.2.2257/TomTomSDKSearch/Structs/SearchResult.html#/s:03TomA9SDKSearch12SearchResultV3poiAA3PoiVSgvp

More detailed information about this service can be found in the Search API Place by ID documentation.