PDA

View Full Version : Verifying an address that is missing city info



nh_capricorn
06-02-2004, 05:46 PM
I am trying to verify a number of addresses, all of which lack the city
information. Is there any way to filter the results returned from a find
address, so that the only address objects returned are those that are in one of the four cities I am interested in? (All of the addresses are in the same state.)

I tried working with the ThresholdScore to resolve this issue, but it didn't
give me exactly what I want.

Can I use a FilterExpression to do this, if so, how? What about trying to match EntityType? (And how would I do this?)

Thanks!

nhc

Anonymous
06-24-2004, 05:39 PM
Hi, if you have Postal or Zip codes, this method I wrote once might help you. Sorry about the indenting...it looks much better in Vis Studio. :oops:

Private Sub DeObfuscate(ByVal fr As MapPoint.FindResults, ByVal Results As GeoCodeResults, ByVal Map As Map, Optional ByVal MaxDistanceFromPcode As Double = 1)

'this function attempt to disobfuscate a "no good results" by testing all
'returned locations and comparing them to the location of a postal code. If
'an address level location is close to the postal code, it is deemed to be the valid one.

Dim aLoc As MapPoint.Location
Dim i As Long

'look for a postal code match
For i = fr.Count To 1 Step -1

aLoc = CType(fr.Item(i), Location)

If aLoc.Type = GeoShowDataBy.geoShowByPostal1 Then
Results.PcodeLoc = aLoc
Exit For
End If

Next

'if a postal code location was found, then scan the list again
'to see if there is a trust-worthy location
If Not Results.PcodeLoc Is Nothing Then
i = 0
For Each aLoc In fr
'scan each plausible location but give up after maximim of 5
'to avoid wasting time.
i = i + 1
If i > 5 Then
Exit For
End If

If aLoc.Type = GeoShowDataBy.geoShowByStreetAddress Or aLoc.Type = GeoShowDataBy.geoShowByDefault Then

If Map.Distance(aLoc, Results.PcodeLoc) < MaxDistanceFromPcode Then
Results.Loc = aLoc
Exit For
End If

End If
Next
End If

End Sub