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
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
6
votes
1 answer

Creating CLPlacemark with custom values for testing

I have an application that moves CLPlacemark objects around and uses them, and I would like to unit-test several components that interact with them. To do this, I would like to be able to stub out calls to real reverse-geolocation from MapKit with…
qqq
  • 1,360
  • 1
  • 9
  • 24
5
votes
1 answer

Getting full address string from CLPLacemark using Swift 4 / Xcode 9

I have previously been able to get a full address String from a CLPlacemark using the following code for Swift 3: let addressList = placemark.addressDictionary?["FormattedAddressLines"] as? [String] let address = addressList!.joined(separator:…
alionthego
  • 8,508
  • 9
  • 52
  • 125
4
votes
2 answers

How to localize an international address especially thoroughfare and subthoroughfare

I'm working on an app that heavily uses addresses in different countries. We have a bunch of ways we input them from getting addresses imported, to dropping pins on map, to reverse geocode our current location. My current project is to correctly…
AdamAM
  • 71
  • 4
4
votes
2 answers

How to set the display name for MKPlacemark?

I'm trying to show routes of two places with Apple's Map. For the two places, I have both names and coordinates. MKMapItem *currentLocation = [[MKMapItem alloc] initWithPlacemark:[[MKPlacemark alloc] …
xi.lin
  • 3,326
  • 2
  • 31
  • 57
4
votes
4 answers

Create Address String from CLPlacemark

Can anyone suggest a cleaner was to create a address string from a CLPlacemark. At present I am using this extension extension CLPlacemark { func makeAddressString() -> String { var address = "" if subThoroughfare != nil {…
DogCoffee
  • 19,820
  • 10
  • 87
  • 120
3
votes
0 answers

What is the accuracy of the areasOfInterest property for a CLPlacemark object?

I noticed that when reverse geocoding location (latitude/longitude to CLPlacemark), the placemark(s) that are returned have an areasOfInterest String array property. Is the list ordered by closest/most accurate areas of interest? What other details…
erikk531
  • 31
  • 1
3
votes
1 answer

CLPlacemark crash in Swift

I'm using CLGeocoder for reverse geolocation and get array of CLPlacemark. When I use GPS outside the US (i.e. -27,127) and then access placemark.postalCode, the app crashes with: "fatal error: unexpectedly found nil while unwrapping an Optional…
VojtaStavik
  • 2,312
  • 1
  • 18
  • 30
2
votes
4 answers

Swift CLGeocoder to get TimeZone

I'm afraid I likely have the completion handler all messed up. What I am trying to do is use latitude and longitude to get a TimeZone. I want the entire function to return the value with a type TimeZone. The following code works, as in I can get the…
AvsBest
  • 435
  • 1
  • 4
  • 9
2
votes
1 answer

SwiftUI - Get User's coordinates to pass in API call

This problem has been haunting me for months and I believe it comes down to my using the wrong structure and procedure. I'm trying to do an API call to Yelp's API and passing in the variables for the user's lat/long. I'm able to grab the lat/long…
Jason Tremain
  • 1,259
  • 3
  • 20
  • 35
2
votes
0 answers

Get business name from CLPlacemark

I'm trying to get the business name from a CLLocation. I am able to get the exact street address by reverse geocoding the CLLocation, but am unable to get the name of the business, as the name property on CLPlacemark is just the address. I have…
soysauce44
  • 41
  • 4
2
votes
1 answer

+placemarkWithLocation method for CLPlacemark

I want to use this method. https://developer.apple.com/reference/corelocation/clplacemark/2132103-placemarkwithlocation?language=objc#declarations I imported CoreLocation but I still get "No known class method" error and I also don't see it defined…
Berry Blue
  • 15,330
  • 18
  • 62
  • 113
2
votes
1 answer

How to get the map_region from CLPlaceMark

I have to take out the map_region and type from CLPlaceMark but I couldn't find a property which will give the map_region values in CLPlaceMark Class. { placeData = { component = ( { …
Jay
  • 153
  • 2
  • 13
2
votes
2 answers

Extending CLPlacemark results in EXC BAD ACCESS

Though there is a similar question found here it does not provide an answer, at least not for the general problem. My problem is: Since CoreLocation geocoding is rate limited and the (web-)service I am developing an app for provides its own…
Haensl
  • 343
  • 3
  • 16
2
votes
2 answers

Check if CLPlacemark's name is a street address

Is it possible to check whether or not a CLPlacemark's name is a street address? I would like to display the name if it is a shopping center, theme park, school, or something else interesting, but not if it is a street address. I was thinking about…
Jojodmo
  • 23,357
  • 13
  • 65
  • 107
1
2 3 4