PBRequesterErrorDomain errors with reverse geocoding
'm going absolutely crazy, and don't know if I am having problems, or if google is having problems. This is the error I am receiving when I attempt to make a reverse geocoding request:
/SourceCache/ProtocolBuffer/ProtocolBuffer-26/Runtime/PBRequester.m:523 server returned error: 503
2009-10-25 02:40:07.127 Reverse geocoding for Zip code/Country/City failed with error Error Domain=PBRequesterErrorDomain Code=6001 "Operation could not be completed. (PBRequesterErrorDomain error 6001.)"
My application worked perfectly, but now I started to have the same error. I wonder if it is related to number of geocoded requests from the device. I am debugging my app, so may be I sent too many geocode requests?
I tried other sample which worked before and it stop working. So it is either service problem or denied geocoding requests for some reason
My application worked perfectly, but now I started to have the same error. I wonder if it is related to number of geocoded requests from the device. I am debugging my app, so may be I sent too many geocode requests?
I tried other sample which worked before and it stop working. So it is either service problem or denied geocoding requests for some reason
Any ideas? It is only a problem with my app, the google maps app works ok including reverse geocoding!
Update - The app is also deployed on another iphone with a different location, network etc and it's experiencing the same problem. Is the google reverse geocoding aware of the app?
Any ideas? It is only a problem with my app, the google maps app works ok including reverse geocoding!
Update - The app is also deployed on another iphone with a different location, network etc and it's experiencing the same problem. Is the google reverse geocoding aware of the app?
Both of my apps just started working again!!! So here what I think took place:
1. Google limits number of geocoding requests
2. Hence Apple's guidance (in iPhone OS Programming guide) how to use geocoder sparingly (batch request, not too many requests, etc)
3. My original code did not have any optimizations.
4. production code sends much fewer requests.
So I think the problem is too many requests from the specific device.
On the separate note, there are other services to look into, like cloudmade.com, to to geocoding
I have the exact same problem. Are you sure it's a problem with too many requests? If so, why am I getting the same error in the simulator?
No, I am not really sure. However when I had a problem, it also occured in the simulator in addition to normal device. It could also be a service outage on Google's part.
Now the same code works fine for me in the Sim and on the device
No, I am not really sure. However when I had a problem, it also occured in the simulator in addition to normal device. It could also be a service outage on Google's part.
Now the same code works fine for me in the Sim and on the device
Definitely Google!
Here in Sydney, without fail reverse geocoder stops working late Saturday afternoon and late Sunday afternoon.
However as one of you guys said the maps app is unaffected. Therefore I suspect some sort of throttling going on to ensure that the "showpiece" app keeps working.
You can of course always store the lat long and make the call later, but I think this is mildly annoying.
I use the spreadsheet, pics, docs, calendar etc. and find them really reliable. I don't want to go and spend time writing the code if the same failure is going to occur.. anyone tried this? Would love to hear if the same prob occurs !
I too am experiencing this problem both on the device and within the simulator, and I don't think it's related to the number of requests within a certain time period, etc. Instead, I believe it is time based as I am CONSISTENTLY seeing this error after 5PM PST. Sometime in the morning on the next day the problem consistently goes away. The error always returns at sometime after 5PM PST. Note that this happens on both the device on 3G/WIFI and in the simulator.
I really hope we can get to the bottom of this soon.
To be clear, I am using the Google Map within the MapKit.h and MKReverseGeocoder.h libraries.
The error details are:
"Error - Operation could not be completed. (PBRequesterErrorDomain error 6001.)"
Quote:
Originally Posted by DAW
Definitely Google!
Here in Sydney, without fail reverse geocoder stops working late Saturday afternoon and late Sunday afternoon.
However as one of you guys said the maps app is unaffected. Therefore I suspect some sort of throttling going on to ensure that the "showpiece" app keeps working.
You can of course always store the lat long and make the call later, but I think this is mildly annoying.
I use the spreadsheet, pics, docs, calendar etc. and find them really reliable. I don't want to go and spend time writing the code if the same failure is going to occur.. anyone tried this? Would love to hear if the same prob occurs !
I'm having the exact same problem and I've also tested it with different apps. Reverse dies after 5:00 PM each night in both Seattle and Portland. I think it might be because of a server change...
I've been having the same problem-- works in the morning, stops working at night.
Here's my theory. We know that Google throttles reverse-geocoding requests by IP. My suspicion is that this throttling is reset at midnight each night and that MKReverseGeocoder passes its requests through a centralized caching proxy; since that proxy would appear as a single IP to Google, it stops working at a certain point during the day.
In any case, I ripped MKReverseGeocoder out of my app and rolled my own custom class using Google's new REST API (Geocoding - Google Maps API Services - Google Code) , and the app has been working great.
Hope this helps. The other thing someone could do is to try complaining to Apple and/or Google and get them to fix this, but rolling my own was easy enough and I didn't want to wade through the support bureaucracy.
If all the quests from Apple appear to be from one IP or a series of IPs that are being cached by Google, this could be a good reason.
I too also ended up using Google's new REST API for a custom handler that I used on the server side for other lookups, but you have to be careful that you make only a certain number of requests per day. A single user of your iPhone app could make too many requests in one day to the Google REST API and it could block them. I ended up using Memcached to cache the results since the location I'm checking only changes every other day.
I've been having the same problem-- works in the morning, stops working at night.
Here's my theory. We know that Google throttles reverse-geocoding requests by IP. My suspicion is that this throttling is reset at midnight each night and that MKReverseGeocoder passes its requests through a centralized caching proxy; since that proxy would appear as a single IP to Google, it stops working at a certain point during the day.
In any case, I ripped MKReverseGeocoder out of my app and rolled my own custom class using Google's new REST API (Geocoding - Google Maps API Services - Google Code) , and the app has been working great.
Hope this helps. The other thing someone could do is to try complaining to Apple and/or Google and get them to fix this, but rolling my own was easy enough and I didn't want to wade through the support bureaucracy.
Even though I'm not planning on switching back to MKReverseGeocoder, I'm interested to see how long it'll take Apple and Google to fix it. This forum was very helpful to me in pinpointing the issue as a time-of-day problem; otherwise, I'm not sure how long it would have taken me to figure it out.
You can see my blog post on my new app, which uses MapKit; I reference this forum for helping me figure out what was going on.
I'm going to go ahead and push my app with MKReverseGeocoder and complain to apple. Hopefully they'll work it out with google. I'm sure they don't want a broken API.
Maybe this problem occurred when the Droid was released. I wonder if android apps have the same issue...
Curiously enough the Google Maps iPhone app doesn't exhibit this problem
Quote:
Originally Posted by sbarham
I'm going to go ahead and push my app with MKReverseGeocoder and complain to apple. Hopefully they'll work it out with google. I'm sure they don't want a broken API.
Maybe this problem occurred when the Droid was released. I wonder if android apps have the same issue...
I'm going to go ahead and push my app with MKReverseGeocoder and complain to apple.
Don't! The Google one is infinitely better. So much quicker!
// Show network activity Indicator (no need really as its very quick)
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
// Use Google Service
// OK the code is verbose to illustrate step by step process
// Form the string to make the call, passing in lat long
NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%lf,%lf&output=csv&sensor=false&key=swizzlec hops", coordinate.latitude,coordinate.longitude];
// Turn it into a URL
NSURL *urlFromURLString = [NSURL URLWithString:urlString];
// Use UTF8 encoding
NSStringEncoding encodingType = NSUTF8StringEncoding;
// reverseGeoString is what comes back with the goodies
NSString *reverseGeoString = [NSString stringWithContentsOfURL:urlFromURLString encoding:encodingType error:nil];
// If it fails it returns nil
if (reverseGeoString != nil)
{
// Break up the tokens returned in the string
// They are comma separated
// The first one is the success code (glass always half full)
// Put this into an array to tokenise
NSArray *listItems = [reverseGeoString
componentsSeparatedByString:@","];
// So the first object in the array is the success code
// 200 means everything is happy
if ([[listItems objectAtIndex:0] isEqualToString:@"200"])
{
// Get the address quality
// We should always have this, but you never know
if ([listItems count] >= 1)
{
NSString *addressQuality =[listItems objectAtIndex:1];
// You can store this somewhere 9 is best, 8 is still great
// You can read Googles doco for an explanation
// e.g. [NSNumber numberWithInteger:[addressQuality intValue]]
}
// Get the address string.
// I am just creating another array to extract the quoted address
NSArray *quotedPart = [reverseGeoString componentsSeparatedByString:@"\""];
// It should always be there as objectAtIndex 1
if ([quotedPart count] >= 2)
{
NSString *address = [quotedPart objectAtIndex:1];
}
}
}
Sorry to resume this thread but I've missed it the first time around.
Problem with that code DAW is that that key is per platform/app not per IP, so you will reach your daily limit quite quickly if you distribute your app with just 1 key.
MKReversegeocode instead uses a key per IP address, so you'll rarely hit the daily limit.
Now, I'm still getting that throttling quite constantly but I've lost my hopes of seeing it fixed by google.
What's anyone else is using? I dont mind paying a decent price for a good service. My fear is that google will have the best database but their pricing is a bit obscure, I know they ask you about 6k a year for using maps in your paid app but not sure how much they would charge for rev geocoding.
i'm using mkreversegeocoder from mapkit with no problem.
take a look at
geonames.org, retrieving city is a bit strange but it works
Yes no problems until you run into the throttling issue, which at some point your will
The thing is, they say you can do 2000 requests per day before you get cut off, but that's a lie, the throttling seems to be whenever they decide their servers are too busy, even if it's your first request.
And again, it's the fact that is unpredictable that makes it very hard to use it on large scale projects. Sometimes I can run it for a week without any issue and some others I can't get 1 day without a problem...
Will have a look at geonames.org as soon as I finish to write this
mhmmm in documentation i've read that if you use MKReversegeocoder from mapkit you can do not 2000 but 20000 request x day x ip (and you must show a maps in your application if you user mkreversegeocoder but this is another issue).
i've read also this: using their API you can do a reverse geocode query every 60 second. i'm releasing an app and i'm working to modify this.
ps the cool thing of geonames is that you can download for free list of cities and coordinate, ando other stuff for free, snapshoot refresh every day, if you've a server online you can build your own geocodeserver
hi dado (davide)?
mhmmm in documentation i've read that if you use MKReversegeocoder from mapkit you can do not 2000 but 20000 request x day x ip (and you must show a maps in your application if you user mkreversegeocoder but this is another issue).
Yes so that is the whole point. They are telling you a lie
As it happens sometimes when they "throttle" their servers you can't even do a single request, it will just throw that PBblblalbblalah 503 error.
So you may be lucky and never get it in production only to discover one day when your app is on the shelves that no-one is able to connect... Very frustrating.