QueryCircle method

Given a location as a circle center point and the radius distance from it, returns a Recordset object containing the records within the area of the circle. Returns an error for DataSet objects with a HowCreated property of geoDataSetDemographic.

Applies to

Objects:  DataSet

Syntax

object.QueryCircle(Center, Radius)

Parameters

Part Description
object Required. An expression that returns a DataSet object.
Center Required Location object. Location on the map that represents the center point of the circle.
Radius Required Double. Distance from the specified Center, in GeoUnits.

Remarks

To return or set GeoUnits, use the Units property of an Application or MappointControl object.

Example

  
      Sub QueryRecordsInCircleAtCenterOfMap()
    Dim objApp As New MapPoint.Application
    Dim objMap As MapPoint.Map
    Dim objDataSet As MapPoint.DataSet
    Dim objRecords As MapPoint.Recordset
    Dim lngCount As Long

    'Set up application and objects to use
    objApp.Visible = True
    objApp.UserControl = True
    Set objMap = objApp.ActiveMap
    lngCount = 0

    'Let user create a data map
    Set objDataSet = _
      objApp.ActiveMap.DataSets.ShowImportWizard

    'Find records in circle
    Set objRecords = objDataSet.QueryCircle(objMap.Location, 2000)
    objRecords.MoveFirst
    Do While Not objRecords.EOF
      lngCount = lngCount + 1
      objRecords.MoveNext
    Loop
    MsgBox "Number of records in circle: " & lngCount
  End Sub