FindResult.Score Property
FindResult.Score Property
The score of the found result.
Public Score As System.Double
[C#]
public System.Double Score;
Remarks
For the FindServiceSoap.FindNearby and FindServiceSoap.FindNearRoute methods, the Score property is the distance from the search point (latLong), in distance units (DistanceUnit enumeration) as specified in the UserInfoFindHeader.DefaultDistanceUnit property.
For the FindServiceSoap.Find and FindServiceSoap.FindAddress methods, the Score property is the confidence level of the result. The range is 0 through 1 (worst to best).
This property has no significance for the FindServiceSoap.FindByID, FindServiceSoap.FindByProperty, and FindServiceSoap.FindPolygon methods. The Score is always 1.0 if there is a match, and 0.0 if there is no match.
For the Find and FindAddress methods, 0.85 (the MapPointConstants.FindScoreThreshold property) is the lowest score considered good for a found result.
To limit the returned results by score for the Find and FindAddress methods, use the FindOptions.ThresholdScore property.
Example
[Visual Basic]
'Iterate through each find result and output it
'if it is a good match
Dim findSpec As New FindSpecification()
findSpec.DataSourceName = "MapPoint.NA"
findSpec.InputPlace = "Seattle, WA"
Dim foundResults As FindResults
foundResults = findService.Find(findSpec)
Dim constants As New MapPointConstants()
Dim fr As FindResult
For Each fr In foundResults.Results
If (fr.Score > constants.FindScoreThreshold) Then
Console.WriteLine(fr.FoundLocation.Entity.DisplayName)
End If
Next
[C#]
//Iterate through each find result and output it
//if it is a good match
FindSpecification findSpec = new FindSpecification();
findSpec.DataSourceName = "MapPoint.NA";
findSpec.InputPlace = "Seattle, WA";
FindResults foundResults;
foundResults = findService.Find(findSpec);
MapPointConstants constants = new MapPointConstants();
foreach(FindResult fr in foundResults.Results)
{
if (fr.Score > constants.FindScoreThreshold)
{
Console.WriteLine(fr.FoundLocation.Entity.DisplayName);
}
}
See Also
FindResult Class | FindServiceSoap Class | DistanceUnit Enumeration | UserInfoFindHeader.DefaultDistanceUnit Property | FindOptions.ThresholdScore Property