Search results for

“geocodeAddressString”

18 results found

Post

Replies

Boosts

Views

Activity

CLGeocoder geocodePostalAddress returning a lot of kCLErrorGeocodeFoundNoResult errors
I have been using CLGeocoder’s “geocodePostalAddress” API for many years, and it’s been working just fine. Since yesterday, a lot of users have started complaining that they are getting “no results” for their geocoding requests, and I have also confirmed this case. It seems like the “geocodePostalAddress” returns “No Result” in many cases where it used to work correctly before, even though the “geocodeAddressString” API still works correctly. Has anyone else noticed this problem? Has there been some server change that is causing this? Here's a unit test I wrote to test this out: import CoreLocation final class CJTestCLGeocoderRequests: XCTestCase { func testGeocoderWithCNPostalAddressBerkeley() async throws { let geocoder = CLGeocoder() do { let postalAddress = CNMutablePostalAddress() postalAddress.street = 2300 College Ave postalAddress.city = Berkeley postalAddress.state = CA postalAddress.postalCode = 94108 postalAddress.country = United States let placemarks3 = try await geocoder.geocodePostalAd
2
0
1.1k
Nov ’22
xcode quit unexpectedly
I want to read almost a million addresses in foor loop using CLGeocoder and save their coordinates. I have also put a 2 second pause in each loop, but every time I want to run the program in Xcode, after 200 or 300 iterations, the program closes suddenly. Does anyone know the reason? Is there a problem with the code? here is my code : func createCSV(from recArray:[Dictionary]) { var csvString = (Adresse);(latitute );(longitude)nn for dct in recArray { csvString = csvString.appending((String(describing:dct[Adresse]!));(String(describing: dct[latitute]!));(String(describing: dct[longitude]!))n) } let fileManager = FileManager.default do { let path = try fileManager.url(for: .documentDirectory, in: .allDomainsMask, appropriateFor: nil, create: false) let fileURL = path.appendingPathComponent(CSVRec.csv) try csvString.write(to: fileURL, atomically: true, encoding: .utf8) } catch { print(error creating file) } } func getLocation(for address: String) async throws -> CLLocationCoordinate2D { guard let coordinate
1
0
1k
Nov ’22
Show Directions in MapView not Maps App
Hi,I'm trying to show directions on a MKMapView from a users current location to a desired location chosen by the user. I've got it working to when user selects a location, it will open it in the Apple Maps app. I would like he directions to show on the MapView within my app.The code is below. I'm under time pressure also so an answer would be really great ASAP.import UIKit import MapKit class LocationSearchTable : UITableViewController { var handleMapSearchDelegate:HandleMapSearch! / var matchingItems:[MKMapItem] = [] var mapView: MKMapView! func parseAddress(selectedItem:MKPlacemark) -> String { / let firstSpace = (selectedItem.subThoroughfare != nil && selectedItem.thoroughfare != nil) ? : / let comma = (selectedItem.subThoroughfare != nil || selectedItem.thoroughfare != nil) && (selectedItem.subAdministrativeArea != nil || selectedItem.administrativeArea != nil) ? , : / let secondSpace = (selectedItem.subAdministrativeArea != nil && selectedItem.administrativeArea != nil) ?
0
0
808
Jun ’16
CLGeocoder geocodePostalAddress returning a lot of kCLErrorGeocodeFoundNoResult errors
I have been using CLGeocoder’s “geocodePostalAddress” API for many years, and it’s been working just fine. Since yesterday, a lot of users have started complaining that they are getting “no results” for their geocoding requests, and I have also confirmed this case. It seems like the “geocodePostalAddress” returns “No Result” in many cases where it used to work correctly before, even though the “geocodeAddressString” API still works correctly. Has anyone else noticed this problem? Has there been some server change that is causing this? Here's a unit test I wrote to test this out: import CoreLocation final class CJTestCLGeocoderRequests: XCTestCase { func testGeocoderWithCNPostalAddressBerkeley() async throws { let geocoder = CLGeocoder() do { let postalAddress = CNMutablePostalAddress() postalAddress.street = 2300 College Ave postalAddress.city = Berkeley postalAddress.state = CA postalAddress.postalCode = 94108 postalAddress.country = United States let placemarks3 = try await geocoder.geocodePostalAd
Replies
2
Boosts
0
Views
1.1k
Activity
Nov ’22
xcode quit unexpectedly
I want to read almost a million addresses in foor loop using CLGeocoder and save their coordinates. I have also put a 2 second pause in each loop, but every time I want to run the program in Xcode, after 200 or 300 iterations, the program closes suddenly. Does anyone know the reason? Is there a problem with the code? here is my code : func createCSV(from recArray:[Dictionary]) { var csvString = (Adresse);(latitute );(longitude)nn for dct in recArray { csvString = csvString.appending((String(describing:dct[Adresse]!));(String(describing: dct[latitute]!));(String(describing: dct[longitude]!))n) } let fileManager = FileManager.default do { let path = try fileManager.url(for: .documentDirectory, in: .allDomainsMask, appropriateFor: nil, create: false) let fileURL = path.appendingPathComponent(CSVRec.csv) try csvString.write(to: fileURL, atomically: true, encoding: .utf8) } catch { print(error creating file) } } func getLocation(for address: String) async throws -> CLLocationCoordinate2D { guard let coordinate
Replies
1
Boosts
0
Views
1k
Activity
Nov ’22
Show Directions in MapView not Maps App
Hi,I'm trying to show directions on a MKMapView from a users current location to a desired location chosen by the user. I've got it working to when user selects a location, it will open it in the Apple Maps app. I would like he directions to show on the MapView within my app.The code is below. I'm under time pressure also so an answer would be really great ASAP.import UIKit import MapKit class LocationSearchTable : UITableViewController { var handleMapSearchDelegate:HandleMapSearch! / var matchingItems:[MKMapItem] = [] var mapView: MKMapView! func parseAddress(selectedItem:MKPlacemark) -> String { / let firstSpace = (selectedItem.subThoroughfare != nil && selectedItem.thoroughfare != nil) ? : / let comma = (selectedItem.subThoroughfare != nil || selectedItem.thoroughfare != nil) && (selectedItem.subAdministrativeArea != nil || selectedItem.administrativeArea != nil) ? , : / let secondSpace = (selectedItem.subAdministrativeArea != nil && selectedItem.administrativeArea != nil) ?
Replies
0
Boosts
0
Views
808
Activity
Jun ’16