SpatialFilter

The SpatialFilter method is used to spatially filter X, Y and Z coordinates in the worksheet. This can be useful when pre-filtering data before creating a post map, variogram, or grid file. New data are added to the bottom of the worksheet. Returns a Boolean. Returns 'True', if the process is successful, else, returns 'False'.

Syntax

object.SpatialFilter( xSourceCol, ySourceCol, zSourceCol, xTargetCol, yTargetCol, zTargetCol, ExclusionFilter, DupMethod, xDupTol, yDupTol )

Parameter

Type

Required/

Optional

Default

Description

xSourceCol

Long

Required

This specifies the X axis source column

ySourceCol

Long

Required

This specifies the Y axis source column

zSourceCol

Long

Required

This specifies the Z axis source column

xTargetCol

Long

Required

This specifies the X axis destination column

yTargetCol

Long

Required

This specifies the Y axis destination column

zTargetCol

Long

Required

This specifies the Z axis destination column

ExclusionFilter

Variant

Optional

""

This specifies the equation written as a string.

DupMethod

SrfDupMethod

Optional

srfDupAll

This specifies the method for retaining duplicates.

xDupTol

Double

Optional

0.0

This specifies the separation distance of X values to be considered duplicates.

yDupTol

Double

Optional

0.0

This specifies the separation distance of Y values to be considered duplicates.

Remarks

If xDupTol or yDupTol are omitted these values are assumed to be 0. This means the points must be exactly the same to be considered duplicates.

If no ExclusionFilter is specified no filtering will be preformed.

Example

This example filters points from a data file with x and y values greater than 6 units and removes all duplicates within a range of 0.5 units.

'Declares SurferApp as an object

Dim SurferApp As Object

 

'Creates an instance of the Surfer Application object and assigns it

'to the variable named "SurferApp"

Set SurferApp = CreateObject("Surfer.Application")

 

'Makes Surfer visible

SurferApp.Visible = True

 

'Declares Wks as an object

Dim Wks As Object

 

'Opens the sample Demogrid.DAT file as a worksheet document

Set Wks = SurferApp.Documents.Open(FileName:=SurferApp.Path+"\Samples\Demogrid.DAT")

 

'Performs the Spatial Filter operation

Wks.SpatialFilter( xSourceCol:=1 , ySourceCol:=2, zSourceCol:=3, _

xTargetCol:=4, yTargetCol:=5, zTargetCol:=6, _

ExclusionFilter:="y > 6.0 OR x > 6.0", DupMethod:=srfDupNone, _

xDupTol:=0.5, yDupTol:=0.5 )

Used by: WksDocument object

See Also

Spatial Filter