Questions tagged [clgeocoder]

The CLGeocoder class provides services for converting between a coordinate (specified as a latitude and longitude) and the user-friendly representation of that coordinate.

The CLGeocoder class provides services for converting between a coordinate (specified as a latitude and longitude) and the user-friendly representation of that coordinate. A user-friendly representation of the coordinate typically consists of the street, city, state, and country information corresponding to the given location, but it may also contain a relevant point of interest, landmarks, or other identifying information. A geocoder object is a single-shot object that works with a network-based service to look up placemark information for its specified coordinate value.

http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLGeocoder_class

227 questions
53
votes
9 answers

Convert coordinates to City name?

How to get an address from coordinates using MapKit? I have this code when long press on the map it gets the coordinates: func didLongPressMap(sender: UILongPressGestureRecognizer) { if sender.state == UIGestureRecognizerState.Began { …
Tevfik Xung
  • 968
  • 3
  • 10
  • 18
38
votes
4 answers

kCLErrorDomain error 2 after geocoding repeatedly with CLGeocoder

I have a search bar in my application that the user can type an address into, and it will come up with the geocoded result. The result updates as the user types, according to the following code: - (void)searchBar:(UISearchBar *)searchBar…
jburns20
  • 3,147
  • 2
  • 26
  • 32
26
votes
4 answers

how to localize address result from reverseGeocodeLocation?

My iphone app supposed to resolve address based on latitude and longitude of the user. reverseGeocodeLocation works fine, but results are in english. Is there a way to localize the results to other languages? couldnt find any information about it at…
user513790
  • 1,225
  • 1
  • 13
  • 22
20
votes
7 answers

CLPlacemark - State Abbreviations?

I was wondering if it was possible to get the state abbreviations from CLPlacemark? In the CLPlacemark Reference from Apple it states: administrativeArea The state or province associated with the placemark. (read-only) @property(nonatomic, readonly)…
sridvijay
  • 1,526
  • 18
  • 39
16
votes
10 answers

How to get formatted address NSString from AddressDictionary?

Trying to get formatted address from AddressDictionary, that I got from CLGeocoder. Used following code with no result: subtitle = [NSString stringWithString:[[addressDict objectForKey:@"FormattedAddressLines"]objectAtIndex:0]]; Also…
Shmidt
  • 16,436
  • 18
  • 88
  • 136
16
votes
4 answers

CLGeocoder returns wrong results when city name is equal to some country's name (and not only)

In one of my apps I need to add an ability to find a city by its name. I am using CLGeocoder to achieve this and I want it to have a behaviour identical to iOS weather app. Below is the code which I…
Andriy Gordiychuk
  • 6,163
  • 1
  • 24
  • 59
15
votes
3 answers

CLGeocoder returning error : The operation couldn’t be completed. (kCLErrorDomain error 8.)

I am calling this function once I get the addressString: [[self geocoder] geocodeAddressString:addressString completionHandler:^(NSArray *placemarks, NSError *error) { if (error) { block(nil, nil, error); }…
tech savvy
  • 1,417
  • 4
  • 21
  • 42
10
votes
2 answers

CLGeocoder ever return one placemark

I want to revive this and this question because the problem still persists for me, so I'm writing a new question. This is my code: - (SVGeocoder*)initWithParameters:(NSMutableDictionary*)parameters completion:(SVGeocoderCompletionHandler)block…
Alex75
  • 527
  • 6
  • 20
10
votes
2 answers

Get current city and country from CLGeocoder?

I've been all over the internet trying to find out how to get the city and country from CLGeocoder. I can get the longitude and latitude easily but I need the city and country information, and I keep running into deprecated methods and such, any…
Jon Sullivan
  • 399
  • 2
  • 5
  • 11
9
votes
2 answers

CLGeocodeCompletionHandler only has one placemark entry

The documentation for - (void)geocodeAddressString:(NSString *)addressString completionHandler:(CLGeocodeCompletionHandler)completionHandler; The documentation clearly states: In the case of forward-geocoding requests, multiple placemark objects …
Nils Munch
  • 8,805
  • 11
  • 51
  • 103
9
votes
2 answers

CLGeocoder Only Returning One Placemark

I have a problem with CLGeocoder where when I call geocodeAddressString:withCompletionHandler I only ever get one result back, despite knowing that the inputted string should return more than one value. The class reference even states: In the case…
prince
  • 506
  • 6
  • 18
9
votes
3 answers

CLGeocoder returning locations in other countries

I have the following code: CLGeocoder *_geo = [[CLGeocoder alloc] init]; CLRegion *region = [[CLRegion alloc] initCircularRegionWithCenter: CLLocationCoordinate2DMake(37.33233141, -122.03121860) radius:100 identifier:@"San Francisco"]; [_geo…
ninjaneer
  • 6,951
  • 8
  • 60
  • 104
8
votes
1 answer

Searching for city names in ios

I want to provide a user-input field in my iPad app, where the user can type the name of a city or location, and the app should present a list of possible cities/locations where the user can select from, and I can get the geo coordinates from (to…
user826955
  • 3,137
  • 2
  • 30
  • 71
8
votes
2 answers

How to get multiple placemarks from CLGeocoder

Whatever address i give to the geocoder ([geocoder geocodeAddressString:completionHandler:), it always puts only one object in the placemarks array. I there any way to get multiple results (like in Maps app) from which the user can select one?
johsem
  • 83
  • 1
  • 6
7
votes
4 answers

Convert GPS coordinates to a city name / address in Swift

I have a latitude/longitude location that I want to convert to the location name String in Swift. What is the best way to do this? i believe it's best to use the reverseGeocodeLocation function but not exactly sure how to. This is what I have so…
Jeffrey G.
  • 85
  • 1
  • 1
  • 6
1
2 3
15 16