Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

PBRequesterErrorDomain errors with reverse geocoding

dohbofusdohbofus Posts: 2New Users
'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.)"


Any idea? I'm losing my mind over here ;)
Post edited by dohbofus on

Replies

  • dennisdeodennisdeo Posts: 24Registered Users
    edited November 2009
    Hi,

    I'm getting the same error. Anyone found the solution?
  • leonbragleonbrag Posts: 8New Users
    edited November 2009
    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
  • stevehsteveh Posts: 1New Users
    edited November 2009
    leonbrag wrote: »
    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?
  • leonbragleonbrag Posts: 8New Users
    edited November 2009
    steveh wrote: »
    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
  • backofthecupbackofthecup Posts: 5New Users
    edited November 2009
    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?
  • leonbragleonbrag Posts: 8New Users
    edited November 2009
    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
  • DAWDAW Posts: 3New Users
    edited December 2009
    leonbrag wrote: »
    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.

    Has anyone used the Google APIs for reverse geocoding?
    Geocoding - Google Maps API Services - Google Code

    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 !

    David
  • lemonkeylemonkey Posts: 4New Users
    edited December 2009
    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.)"

    DAW wrote: »
    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.

    Has anyone used the Google APIs for reverse geocoding?
    Geocoding - Google Maps API Services - Google Code

    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 !

    David
  • sbarhamsbarham Posts: 2New Users
    edited December 2009
    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...

    Has anyone found a work-around?
  • edparkedpark Posts: 2New Users
    edited December 2009
    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.
  • lemonkeylemonkey Posts: 4New Users
    edited December 2009
    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.

    Also see my latest blog post:

    Ari Braginsky: The Curious Case of MKReverseGeocoder

    edpark wrote: »
    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.
  • edparkedpark Posts: 2New Users
    edited December 2009
    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.
  • sbarhamsbarham Posts: 2New Users
    edited December 2009
    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...
  • lemonkeylemonkey Posts: 4New Users
    edited December 2009
    Curiously enough the Google Maps iPhone app doesn't exhibit this problem :p
    sbarham wrote: »
    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...
  • DAWDAW Posts: 3New Users
    edited January 2010
    sbarham wrote: »
    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=swizzlechops", 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];
    }
    }
    }

    // Hide network activity indicator
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];


    Sorry about the formatting, I am from a generation before posting code on forums :-)
  • ziocletoziocleto Posts: 1,107Registered Users @ @ @ @
    edited April 2010
    DAW wrote: »
    Don't! The Google one is infinitely better. So much quicker!

    NSString *urlString = [NSString stringWithFormat:@"http://maps.google.com/maps/geo?q=%lf,%lf&output=csv&sensor=false&[B]key=swizzlechops[/B]", coordinate.latitude,coordinate.longitude];

    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.
    <a href="http://itunes.apple.com/us/app/id443802549?mt=8" target="_blank">Paper Camera</a><br />
  • zero_zero_ Posts: 99Registered Users
    edited April 2010
    i'm using mkreversegeocoder from mapkit with no problem.
    take a look at
    geonames.org, retrieving city is a bit strange but it works
    <a href="http://itunes.apple.com/it/app/high-altimeter-and-stuff/id368770019?mt=8" target="_blank">high - GPS Tracker and Altimeter Stuff v2.3.1 - new GPS Tracker and other cool Stuff!!!</a>
  • ziocletoziocleto Posts: 1,107Registered Users @ @ @ @
    edited April 2010
    zero_ wrote: »
    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 :)

    Cheers,
    Dado.
    <a href="http://itunes.apple.com/us/app/id443802549?mt=8" target="_blank">Paper Camera</a><br />
  • zero_zero_ Posts: 99Registered Users
    edited April 2010
    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).

    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.

    Can be usefoul?
    <a href="http://itunes.apple.com/it/app/high-altimeter-and-stuff/id368770019?mt=8" target="_blank">high - GPS Tracker and Altimeter Stuff v2.3.1 - new GPS Tracker and other cool Stuff!!!</a>
  • zero_zero_ Posts: 99Registered Users
    edited April 2010
    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
    <a href="http://itunes.apple.com/it/app/high-altimeter-and-stuff/id368770019?mt=8" target="_blank">high - GPS Tracker and Altimeter Stuff v2.3.1 - new GPS Tracker and other cool Stuff!!!</a>
  • ziocletoziocleto Posts: 1,107Registered Users @ @ @ @
    edited April 2010
    zero_ wrote: »
    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.

    So that's the problem everyone is(was?) having.
    <a href="http://itunes.apple.com/us/app/id443802549?mt=8" target="_blank">Paper Camera</a><br />
  • anils_dasanils_das Posts: 51Registered Users
    edited July 2010
    I have tried geonames and the address returned is not proper in all places.

    What is the best solution for this PBRequesterErrorDomain problem
    anil
  • skunkioskunkio Posts: 173Registered Users @ @
    edited December 2010
    Hi guys,
    any update on it? I have the same issue but only if my iphone is connected with wi-fi. Looks work fine under 3g but the position is not really correct.
    Using Maps within my iphone the location is right and works also under wi-fi.
    Any idea?!?

    Grazie,
    saluti
  • greg_greg_ Posts: 1New Users
    edited March 2011
    skunkio wrote: »
    Hi guys,
    any update on it? I have the same issue but only if my iphone is connected with wi-fi. Looks work fine under 3g but the position is not really correct.
    Using Maps within my iphone the location is right and works also under wi-fi.
    Any idea?!?

    This issue ( error 503 ) was fooling me for an hour. I am using CLLocationManager which notifies about updates. Its delegate method -locationManager:didUpdateToLocation:fromLocation: creates an instance of
    MKReverseGeocoder which immediately after creation receives a -start message. I noticed, that often -locationManager:didUpdateToLocation:fromLocation: is called twice in short time span (<1s). In these cases, usually on initialization, the application was crashing. Locking the delegate's method for some time (I used 3s) prevents crashing.
    This may be a separate case but maybe it helps somebody - guaratee only one performing instance of the reverse geocoder at a time.
  • walexwalex Posts: 26Registered Users
    edited May 2011
    DAW wrote: »
    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=swizzlechops", 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];
    }
    }
    }

    // Hide network activity indicator
    [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];


    Sorry about the formatting, I am from a generation before posting code on forums :-)

    A million thanks for this SUPERB code!!!

    :)
Sign In or Register to comment.