Questions tagged [clplacemark]

A CLPlacemark object stores placemark data for a given latitude and longitude. Placemark data includes information such as the country, state, city, and street address associated with the specified coordinate. It can also include points of interest and geographically related data.

A CLPlacemark object stores placemark data for a given latitude and longitude. Placemark data includes information such as the country, state, city, and street address associated with the specified coordinate. It can also include points of interest and geographically related data. Placemark objects are typically generated by a CLGeocoder object, although you can also create them explicitly yourself.

Click Here for Apple docs.

48 questions
1
vote
1 answer

CLPlacemark location gives district info too, why?

I need only the city info of client recent location and not district. Any idea how to avoid? pm.locality returns: Budapest VII. kerület, I would expect only Budapest. func locationManager(manager: CLLocationManager!, didUpdateLocations locations:…
János
  • 32,867
  • 38
  • 193
  • 353
1
vote
1 answer

how to add Latitude and longitude value to nsmutablearray from geocoder values?

I want to add latitude and longitude value to NSMutableArray from geocoder value but I get an error in the image . -(void) loadDataArray:(NSString *) text{ CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder geocodeAddressString:[NSString…
fozoglu
  • 729
  • 5
  • 21
0
votes
0 answers

CLGeocoder's geocodeAddressString always return an array with only one CLPlacemark object

CLGeocoder's geocodeAddressString function always return an array with only one CLPlacemark object, independently of the string passed as a parameter. I'm using it like this: let placesArray = try await…
0
votes
2 answers

How to get CLPlacemark from Location in SwiftLocation 5.1.0?

This is a library that doesn't have a very great documentation, In the past, I had problems migrating from a previous version to a modern version, and now, I have exactly the same problem again. In SwiftLocation 4 this is the way to get the…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
0
votes
1 answer

Swift 5 reverseGeocodeLocation() result in deprecated addressDictionary

I'm using a CLGeoCoder instance to get the city and country of a given set of coordinates (latitude and longitude) through its method reverseGeocodeLocation(). The documentation specifies that this data should be in CLPlacemark's country and…
Omar Khodr
  • 93
  • 6
0
votes
1 answer

Create MKPlacemark/CLPlacemark from human-readable string

Is there a way to create a MKPlacemark from a human-readable string, e.g. the placemark's own description? placemark.description // -> "The Home Depot, 1675 Wilshire Blvd, Los Angeles, CA 90017, United States @ <+34.05726385,-118.27165514> +/-…
alekop
  • 2,838
  • 2
  • 29
  • 47
0
votes
1 answer

Swift ReverseGeocode CLPlacemark areasOfInterest almost always nil. Should I be using something else?

I am using CLGeocoder and reverseGeocodeLocation to get my CLPlacemark. How come the name mostly comes back as an address and areasOfInterest come back as nil? For example... the areasOfInterest appear for really major things like apple HQ and…
Spartakus
  • 69
  • 1
  • 10
0
votes
0 answers

CLPlacemark causes app crash: object is NOT NIL

I ran into an extremely frustrating problem, and I've been struggling with this all afternoon, so please excuse me if I'm all little short in my explanation. My patience is at an extremely low level right now. I want to pass a CLPLacemark object…
Mark Carols
  • 403
  • 4
  • 20
0
votes
1 answer

Location Lookup on Keystroke like Apple Weather app

I'd like to perform a location lookup like the Apple Weather app which shows a table of potential locations with each keystroke. I'm sending the user's input string to the function below each time an "editing changed" event occurs in the text field.…
Gallaugher
  • 1,593
  • 16
  • 27
0
votes
2 answers

Looking for business name information from coordinates using CLLocation and/or Mapkit

I'm trying to use coordinates returned using CLLocationManager to see if they are a close match for any local business - if I happened to be standing in a Starbucks for example, I would want my app to suggest that based on my coordinates I was…
0
votes
2 answers

"downcast from CLplacemark? to Clplacemark only unwraps optional"(swift2)

how to fix this error : "downcast from CLplacemark? to Clplacemark only unwraps optional" so i use this code : if let p = CLPlacemark(placemark: placemarks.first as? CLPlacemark){} and change placemarks[0] array but not work and my code is :…
user1707895
  • 13
  • 1
  • 4
0
votes
1 answer

If let statement with CLPlacemark

I'm trying to make an if let statement with the following: if let p = CLPlacemark(placemark: placemarks?[0]) { Currently it's telling me "Value of optional type 'CLPlacemark?' not unwrapped" and instructing me to put (placemark: (placemarks?[0])!)…
Fumbles
  • 122
  • 7
0
votes
1 answer

swift - How to get my location data and put them in variables for iMessage?

Yesterday I asked a question here in stack Overflow about how to embed my current location in message body I had got an answer and I corrected my code My code works just fine in console, but i couldn't figure out how to get the data from…
O user
  • 97
  • 1
  • 11
0
votes
3 answers

Swift Completion Handler for Reverse Geocoding

I have been banging my head in order to figure out how to fix this piece of code. Basically I have a piece of code that takes a string cityName and stores the latitude and longitude of it in a global variable and call it in another function right…
-1
votes
2 answers

Not able to get subLocality using CLPlacemark in swift

I'm actually building an application in swift. The problem is that the application should get the sublocality from a longitude latitude and check if that subLocality is part of an array but I'm not able to get the sublocality Can any of the…