We operate a route optimisation service, these routes typically involve 100+ deliveries in a small local area several times a day, lots of the deliveries may exist in the same postcode.
As such, when we use MapPoint to add waypoints and optimise the run on postcode & streetname / house number.
Problem is, if you call MapPoints FindAddressResults()
function with a bad streetname but valid postcode, it ignores the postcode and tries finding the streetname elsewhere, often in a random town hundreds of miles away.
Now, whilst we can ask the shops to improve the quality of their data - this will never be done reliably.
My question: when calling FindAddressResults()
, is there any way to make it prioritise the postcode over the streetname as opposed to it's default behaviour which prioritises the streetname over the postcode?
Example usage (This is written in VB6 (dont ask) - but any example / info would help):
'#### GeoCode using postcode & streetname
Set oResults = oMap.FindAddressResults(rsRequest("Request_Address"), , , , rsRequest("Request_Postalcode"))
If oResults.Count = 0 Then
'#### Nothing was found, GeoCode using postcode only
Set oResults = oMap.FindAddressResults(, , , , rsRequest("Request_Postalcode"))
End If
The only thing i can think off is setting a "Max Distance" var, if the 1st (best match) item in oResults[] is over that threshold, default to a postcode only search - but that would be a botch at best.
EDIT 1 - Just came up with this, seems to work OK:
Set oResults = oMap.FindAddressResults(rsRequest("Request_Address"), , , , rsRequest("Request_Postalcode"))
If oResults.ResultsQuality <> geoFirstResultGood Then
echo (rsRequest("Request_Address") & " + " & rsRequest("Request_Postalcode") & " had poor results (" & CStr(oResults.ResultsQuality) & "), using postcode only instead...")
Set oResults = oMap.FindAddressResults(, , , , rsRequest("Request_Postalcode"))
End If