FindServiceSoap.FindByProperty Method

FindServiceSoap.FindByProperty Method

Finds points of interest based on predefined or custom properties. This method is independent of the location information such as distance and latitude/longitude. The found results are returned as a FindResults object.


 
Public Function FindByProperty _
   (ByVal specification As FindByPropertySpecification) _
   As FindResults 

[C#]

 
public FindResults FindByProperty (FindByPropertySpecification specification);

Parameters

  • specification
    The specification of the request to find by property (FindByPropertySpecification object), including the data source name, entity type name and the entity property names and values provided via the where clause or the find filter expression. The find option properties SearchContext and ThresholdScore have no effect on this method.

Remarks

  • The TopScore property is always set to 1.0 for all FindResult objects returned by this method.

  • The FindByProperty method is only valid with customer defined points of interest data sources (and the MapPoint.FourthCoffeeSample data source) that have the find nearby capability. For more information about MapPoint Web Service data sources, see MapPoint Web Service Data Sources and Capabilities.

Example

[Visual Basic]

'Set up the Address object and the FindAddressSpecification object
Dim findService As New FindServiceSoap()
Dim myAddress As New Address()
myAddress.AddressLine = "1 Microsoft Way"
myAddress.PrimaryCity = "Redmond"
myAddress.Subdivision = "WA"
myAddress.PostalCode = "98052"
myAddress.CountryRegion = "US"

Dim findAddressSpec As New FindAddressSpecification()
findAddressSpec.InputAddress = myAddress
findAddressSpec.DataSourceName = "MapPoint.NA"

'Declare the return variable and find the address
Dim foundAddressResults As FindResults
foundAddressResults = findService.FindAddress(findAddressSpec)
If (foundAddressResults.NumberFound = 1) Then
 Console.WriteLine(foundAddressResults.Results(0).FoundLocation.Entity.DisplayName)
Else
 Console.WriteLine("Zero or multiple results found.")
End If



[C#]
 
//Set up the Address object and the FindAddressSpecification object
FindServiceSoap findService = new FindServiceSoap();
Address myAddress =  new Address();
myAddress.AddressLine = "1 Microsoft Way";
myAddress.PrimaryCity = "Redmond";
myAddress.Subdivision = "WA";
myAddress.PostalCode = "98052";
myAddress.CountryRegion = "US";

FindAddressSpecification findAddressSpec = new FindAddressSpecification();
findAddressSpec.InputAddress = myAddress;
findAddressSpec.DataSourceName = "MapPoint.NA";

//Declare the return variable and find the address
FindResults foundAddressResults;
foundAddressResults = findService.FindAddress(findAddressSpec);
if (foundAddressResults.NumberFound == 1) 
{
 Console.WriteLine(foundAddressResults.Results[0].FoundLocation.Entity.DisplayName);
}
else
{
 Console.WriteLine("Zero or multiple results found");
}


See Also

  FindServiceSoap Class   |   FindResults Class   |   FindByPropertySpecification Class   |   EntityType.Definition Property   |   CommonServiceSoap.GetEntityTypes Method