Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. Core Location and Maps > 6.7. Converting Meaningful Addresses to Longitude a...

6.7. Converting Meaningful Addresses to Longitude and Latitude

Problem

You have an address of a location and you want to find the spatial location (longitude, latitude) of that address.

Solution

Use the geocodeAddressString:completionHandler: method of the CLGeocoder class.

Discussion

Reverse geocoding is the process of retrieving a meaningful address, city and country, and so on, using spatial locations (Longitude, Latitude). Geocoding, on the other hand, is the process of finding the spatial locations of a given address. Both geocoding and reverse geocoding facilities are encapsulated into the CLGeocoder class in the CoreLocation framework.

We geocode spatial locations by passing the address as NSString to the geocodeAddressString:completionHandler: method of the CLGeocoder class. The completionHandler parameter of this method accepts a block object that returns no value and has two parameters:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial