How to detect an invalid address

13 posts / 0 new
Last post
Riverbed-Support
How to detect an invalid address

Hi,

 

When calling the Geocoding API, I pass in anything like 'aaaaaaaaaaaaaaaa', MapQuest would return something and if it can't find the location, it would return center of the US, unlike Google Map would return ZERO_RESULTS.

 

Is there a way to detect an invalid address?  

 

Thanks.


MQBrianCoakley
The geocodeQualityCode will
The geocodeQualityCode will indicate how accurate and confident the returned result is. The quality code documentation explains it all and allows you to enter a quality code and get an exact description of that specific code.

Riverbed-Support
Thank you MQBrianCoakley for

Thank you MQBrianCoakley for the direction.


Riverbed-Support
Hi MQBrianCoakley,

Hi MQBrianCoakley,

I get geocoding by 'city, state,country', for US, I got the correct lat, lng but but for other countires MQ returns multiple locations.  If I remove the state for other countries, I got it right.

Ex. Sydney, NSW, AU would return multiple location.  However, Sydney, AU is right.

I would like to confirm that 'city, state, country' is only for the US?

Thanks.


MQBrianCoakley
Nope, it should work for any
Nope, it should work for any country. 5-box input (city=Sydney&state=NSW&country=AU) works as expected. The international geocoder is undergoing a re-write and I will pass this information on to the team to address. Thanks for the information.

Riverbed-Support
Hi MQBrianCoakley,

Hi MQBrianCoakley,

Just want to make sure I am calling the correct API.

I used this URL before:

https://www.mapquestapi.com/geocoding/v1/address?key=KEY&inFormat=kvp&ou...

for 5-box input I can still use:

https://www.mapquestapi.com/geocoding/v1/address?key=KEY&inFormat=kvp&ou...

 

Thanks.


MQBrianCoakley
Yup, that should work great.
Yup, that should work great.

shmuel-s
so the answer for this

so the answer for this question is pointing to diffrent api???


MQBrianCoakley
Nope, not at all. The answer
Nope, not at all. The answer is to judge the result by the quality code - that's what it's there for.

BWD_Admin
So - Can you please give an

So - Can you please give an example of how I would check for an invalid, say, city? Say one of my users enters bcdhd as the city to locate. How would the geocodeQualityCode be used to tell the user that their input is invalid?


MQBrianCoakley
The fourth character in the
The fourth character in the qualityCode is the Administrative Area confidence which will return an A for an exact match, a B for a close match, a C for an approximate match, or an X if there was no provided value.

squirrel72
Why do addresses consistently

Why do addresses consistently fail using the Mapquest Open geocoding API, when identical addreses function in the Bing Maps API?  I am only requesting one to four addresses at a time, yet I can't get decent results from MapQuest.  Or even bad ones.  They end up at 0,0.


MQBrianCoakley
Use the MapQuest licensed API
Use the MapQuest licensed API. You should get much better results. Just change open.mapquestapi to www.mapquestapi.