Sorry, you need to enable JavaScript to visit this website.

Reverse geocoding

Reverse geocoding

Sometimes you need to translate a coordinate into a human-readable street address.
This is often used in tracking applications that receive a GPS feed from a device or asset and need to obtain the corresponding address.
The reverse geocoding endpoint returns the address information described in the Reverse Geocoding API documentation on the Developer Portal.
Sample use case: You want to know the address of a place on the map. You press your finger on the map display,
and address information appears in a balloon on the screen.

Use the code below to try this in your app:

TTReverseGeocoderQuery *query =
[[[[TTReverseGeocoderQueryBuilder createWithCLLocationCoordinate2D:coordinate]
    withReturnRoadUse:true]
  withReturnSpeedLimit:true] build];

[self.mapView.annotationManager removeAllAnnotations];
self.result = NSLocalizedString(@"Loading ...", "");
TTAnnotation *annotation = [TTAnnotation annotationWithCoordinate:coordinate];
[self.mapView.annotationManager addAnnotation:annotation];

[self.reverseGeocoder reverseGeocoderWithQuery:query completionHandle:^(TTReverseGeocoderResponse * _Nullable response, TTResponseError * _Nullable error) {
    TTReverseGeocoderFullAddress *fullAddress = response.result.addresses.firstObject;
    if (fullAddress) {
        self.result = [self addressString: fullAddress.address];
        [self.mapView.annotationManager selectAnnotation:annotation];
    }
}];

You are here