I need to select the best result from the Geocode API when there is a multiple possibles in the response.
Geocode API returns multiple responses with same GeoQualityCode "B1AAA" and different latitude and longitude for provided location "Glenarm Place, Denver, CO".
How to select one best result from the response based on their accuracy?
{
"info": {
"statuscode": 0,
"copyright": {
"text": "© 2018 MapQuest, Inc.",
"imageUrl": "http://api.mqcdn.com/res/mqlogo.gif",
"imageAltText": "© 2018 MapQuest, Inc."
},
"messages": []
},
"options": {
"maxResults": -1,
"thumbMaps": false,
"ignoreLatLngInput": false
},
"results": [
{
"providedLocation": {
"location": "Glenarm Place, Denver, CO"
},
"locations": [
{
"street": "[2000 - 3099] Glenarm Pl",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Denver",
"adminArea5Type": "City",
"adminArea4": "Denver",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "80205",
"geocodeQualityCode": "B1AAA",
"geocodeQuality": "STREET",
"dragPoint": false,
"sideOfStreet": "M",
"linkId": "rnr4257651",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 39.747766,
"lng": -104.985355
},
"displayLatLng": {
"lat": 39.747766,
"lng": -104.985355
}
},
{
"street": "[1300 - 1899] Glenarm Pl",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Denver",
"adminArea5Type": "City",
"adminArea4": "Denver",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "80202",
"geocodeQualityCode": "B1AAA",
"geocodeQuality": "STREET",
"dragPoint": false,
"sideOfStreet": "M",
"linkId": "rnr4257619",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 39.743535,
"lng": -104.990809
},
"displayLatLng": {
"lat": 39.743535,
"lng": -104.990809
}
},
{
"street": "[1101 - 1398] Glenarm Pl",
"adminArea6": "",
"adminArea6Type": "Neighborhood",
"adminArea5": "Denver",
"adminArea5Type": "City",
"adminArea4": "Denver",
"adminArea4Type": "County",
"adminArea3": "CO",
"adminArea3Type": "State",
"adminArea1": "US",
"adminArea1Type": "Country",
"postalCode": "80204",
"geocodeQualityCode": "B1AAA",
"geocodeQuality": "STREET",
"dragPoint": false,
"sideOfStreet": "M",
"linkId": "rnr4269002",
"unknownInput": "",
"type": "s",
"latLng": {
"lat": 39.740774,
"lng": -104.9944
},
"displayLatLng": {
"lat": 39.740774,
"lng": -104.9944
}
}
]
}
]
}
Thanks for your help.
Thanks for your help.