com.mapinfo.midev.language.filter

## Class DistanceFilter

- java.lang.Object
- - com.mapinfo.midev.language.filter.DistanceFilter

All Implemented Interfaces:
  IFilter

    public final class DistanceFilter
    extends Object
    implements IFilter

Defines a filter that specifies features based on the distance between the values of a geometry attribute (column) and a literal geometry value. There are several types of distance filter as indicated by the `DistanceFilterType` enumeration.

### Constructor Summary

Constructors
Constructor and Description
`DistanceFilter(String geometryAttributeName, IFeatureGeometry searchGeometry, DistanceFilterType type, Length distance)` Create a filter that determines if any geometries are within a specified distance of a specified geometry.

### Method Summary

All Methods Instance Methods Concrete Methods
`Length` `getDistance()` Returns the distance to test.
`DistanceFilterType` `getDistanceFilterType()` Returns the type of distance comparison to perform.
`String` `getGeometryAttributeName()` Returns the name of the attribute that will be searched.
`IFeatureGeometry` `getSearchGeometry()` Returns the value to be compared.
`boolean` `isSpatial()` Returns `true`.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DistanceFilter

    public DistanceFilter(String geometryAttributeName,
                          IFeatureGeometry searchGeometry,
                          DistanceFilterType type,
                          Length distance)

Create a filter that determines if any geometries are within a specified distance of a specified geometry.

Parameters:
  `geometryAttributeName` - Filter this geometry column.
  `searchGeometry` - Filters any geometries that are close to this geometry.
  `type` - Determines how distance is calculated.
  `distance` - The maximum distance between the column geometry and the specified geometry.

### Method Detail

#### getGeometryAttributeName

    public String getGeometryAttributeName()

Returns the name of the attribute that will be searched.

Returns:
  the name of the attribute that will be searched.

#### getSearchGeometry

    public IFeatureGeometry getSearchGeometry()

Returns the value to be compared.

Returns:
  the value to be compared.

#### getDistanceFilterType

    public DistanceFilterType getDistanceFilterType()

Returns the type of distance comparison to perform.

Returns:
  the type of distance comparison to perform.

#### getDistance

    public Length getDistance()

Returns the distance to test.

Returns:
  the distance to test.

#### isSpatial

    public boolean isSpatial()

Returns `true`.

Specified by:
  `isSpatial` in interface `IFilter`
Returns:
  `true`.