FindPolygonSpecification Class

MapPoint Web Service is deprecated and will be retired November 18, 2011. Please go to http://www.microsoft.com/maps/mappoint.aspx for information about upgrading to Bing Maps.

Contains the search specification used in the FindPolygon method. Specifies the polygon data source, the search options to use, the filter used to limit the results, and the spatial filter to use.

[Visual Basic]
Public Class FindPolygonSpecification Inherits System.Object
[C#] public class FindPolygonSpecification : System.Object

Public Constructors

NameDescription
public constructorFindPolygonSpecification Constructor Initializes a new instance of the FindPolygonSpecification class.

Public Properties

NameDescription
public propertyDataSourceName

A string representing the name of the data source (DataSource.Name property) in which to find the polygon.

public propertyFilter

The filter (FindFilter object) to apply to the results, including the specific entity type, properties, and values that the returned results must match.

public propertyOptions

The search options (FindOptions object), which may include the range of results and a flag to identify which objects are desired in the returned results.

public propertySpatialFilter

The geographic filter (SpatialFilter object) to apply to the results.


Example


[Visual Basic]

'Set up the Address object and the specification object
'Create a FindPolygonSpecification and then call
'the FindPolygon method.

Dim findPolySpec As New FindPolygonSpecification
Dim filter As New LatLongSpatialFilter
filter.LatLong = New LatLong
filter.LatLong.Latitude = Convert.ToDouble(txtLatitude.Text)
filter.LatLong.Longitude = Convert.ToDouble(txtLongitude.Text)

Dim ff As New FindFilter
ff.EntityTypeName = "MyEntityName"

findPolySpec.SpatialFilter = filter
findPolySpec.DataSourceName = "MyDataSource"
findPolySpec.Filter = ff

Dim results As New FindResults
results = finder.FindPolygon(findPolySpec)

If results.NumberFound = 1 Then
   lblCheckPoint.Text = "The specified point is in the polygon."
Else
   lblCheckPoint.Text = "The specified point is not in the polygon."
End If

[C#] //Create a FindPolygonSpecification and then call //the FindPolygon method. FindPolygonSpecification findPolySpec = new FindPolygonSpecification(); LatLongSpatialFilter filter = new LatLongSpatialFilter(); filter.LatLong = new LatLong(); filter.LatLong.Latitude = Convert.ToDouble(txtLatitude.Text); filter.LatLong.Longitude = Convert.ToDouble(txtLongitude.Text); FindFilter ff = new FindFilter(); ff.EntityTypeName = "MyEntityName"; findPolySpec.SpatialFilter= filter; findPolySpec.DataSourceName="MyDataSource"; findPolySpec.Filter = ff; FindResults results = finder.FindPolygon(findPolySpec); if (results.NumberFound==1) { lblCheckPoint.Text="The specified point is in the polygon."; } else { lblCheckPoint.Text="The specified point is not in the polygon."; }

See Also

  FindServiceSoap Class   |   FindServiceSoap.FindPolygon Method   |   Working with Polygons  

Show: