I have a couple questions on how to get the best result out of the geocoding APIs. Just for reference purposes I'll list the three calls here:
- Match(String sourceText)
- Match(String street, String zipcode)
- Match(String street, String city, String state)
The main problem is that I don't know which pieces of the address I'm going to obtain from the client, I could receive as little as one piece of information, or I could receive the full address including house number, street, city, state, and zip code. At the same time, I don't necessarily want to call all three functions with the information I do receive because that might be time consuming in some cases. Is there a way for me to efficiently use these APIs to receive the best result if I'm given partial address information?
I noticed in another forum post that the first API shouldn't contain the house number and zip code, and should contain one or the other, and in my testing I've noticed that the second API is usually the fastest(and if it returns a result, it's the correct result, as far as I can tell). So what I've been thinking of is something like this:
1. if street and zip are not null or empty, use API #2
2. if no answer comes back, use APIs 1 and 3 based on the information given by the client
Which API would be better to use first(assuming complete information is given)? Also, for the first API, do you know if it's better to give the house number, street, city, and state, or is it better to use the street, city, state, and zip code? I would expect the house number, street, city, and state to return a more accurate result, since each street has multiple sections and calling the first API with a zipcode and no house number may give the right street, but the wrong section.
I've also noticed when using the first API, if I do give it all pieces(house number and zip code included) the best result returns a good chunk of the time, but I have noticed calling the first API without a zip code is fairly slow compared to without(which I understand is because the search area is reduced greatly by having the zip code in there).
Thanks in advance,
Ryan