Reimers.dk

.NET, AJAX and Google APIs brought together
Welcome to Reimers.dk Sign in | Join | Help
in Search

No success or fail call if address is not found

Last post 07-31-2009, 12:41 by jjrdk. 5 replies.
Sort Posts: Previous Next
  •  07-30-2009, 21:05 2686

    No success or fail call if address is not found

    I am using the Atlas service to look up addresses so I can then plot locations on a Silverlight map. My application uses addresses from a GEDCOM (Genealogy) file which are not always formatted well or can include the name of a cemetery or hospital.

    The approach I take is to receive a list of addresses, query the first, wait for a result, plot a marker, query the next and so on. It seems that when an address is not found there is no call to either the succes or the fail method. This can mean that not all addresses are queried.

    Is this true that no method is called? Do you have an alternative suggestion? I thought it best to avoid threads and simple query the addresses one after another.

     Thanks

    Filed under:
  •  07-31-2009, 0:49 2687 in reply to 2686

    Re: No success or fail call if address is not found

    If an address is not found the geocoder will not invoke a success callback. Only if the request results in an error will the failure callback be invoked. So in your case the answer may be that the addresses are simply not found. Maybe the method should be changed to return null if no address is found.

    The method is performed asynchrounously, so you should be able to send all the requests without waiting for a response. 

    Would you mind sharing some addresses which are not working for you?

  •  07-31-2009, 9:59 2688 in reply to 2687

    Re: No success or fail call if address is not found

    My first approach was to have a loop which sent off the address requests but I wasn't sure how your server would like it if I send 10 requests at once :).

    The main issue for me was relating the result back to the original request. I have objects which describe an event e.g. birth. The object contains date, text and location information. I want to be able to convert the location text into a geo-location and plug it back into the original object. I couldn't think of a mechanism to do that. Perhaps the success method could pass back a user-defined object reference? That would help me.

    Would it be wrong to call the success method even if an address is not found? The result count would simply be 0. I know it doesn't sound very successful but the call itself did function and my chained approach would work. It just seems to me to be a situation which is not covered: the call is successful but no matching address was found.

    The two addresses which I have which don't work are:

    Hollybrook Cemetery, Southampton, GB

    Sloane Hospital, Beckenham, GB

    Google Maps does actually find the first address but I haven't tried the other one.

    What are the terms of use for your atlas service? I had originally looked at bing but that look too expensive. This is only a little project for displaying the results of my aunt's Family Tree research so I don't want it to get expensive.

  •  07-31-2009, 11:08 2689 in reply to 2688

    Re: No success or fail call if address is not found

    Currently the service is free (except for voluntary donations), as it is still in beta stage.

    I tried looking up Hollybrook cemetary in the geocoder, and as you said it doesn't find it. However if I pass in the same text to the LocalSearch method, then it finds it at 212 Tremona Road, SO16 6 Southampton, GB. Sloane Hospital is found on Albemarle Road, BR3 5 Bromley, GB

    A cemetary or a hospital is not an actual address, so if you don't find an result and you can see that it may not actually be a street name (or higher level) that you are passing, then you can try the local search as fall back.

    I'll look in to changing the method to either pass back null or an empty result list (probably the latter).

    Filed under: ,
  •  07-31-2009, 12:04 2690 in reply to 2689

    Re: No success or fail call if address is not found

    Thanks

    How does the local search work? Do I have to give a point which is fairly close to where I think the address will be or can I just enter 0,0?

    I realise that cemeteries, hospitals etc are not normal addresses. I don't need complete accuracy - just a rough indication of where events in family members lives occured.

    I would prefer an empty list result - seems to mirror the facts better than a null IMHO.

    Thanks for providing the service and for your help!

    Paul

  •  07-31-2009, 12:41 2691 in reply to 2690

    Re: No success or fail call if address is not found

    I tried the local search on the map page - http://www.reimers.dk/atlas/map.aspx. I made the query when I was centered at 0,0 and it returned the result. This is probably because the search terms is sufficiently precise to narrow down. If you had searched for 'Sloane Hospital' centered at 0,0 it probably would not have returned any results (or too many to be of use).
View as RSS news feed in XML