Interface ISpatialFilter

Namespace
ESRI.ArcGIS.Geodatabase
Assembly
ESRI.Server.Geodatabase.dll

Provides access to members that return and modify the type of spatial relationship that the filter will use.

[Guid("FDFEBD94-ED75-11D0-9A95-080009EC734B")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ISpatialFilter : IQueryFilter

Properties

FilterOwnsGeometry

Indicates whether the filter owns the query geometry.

bool FilterOwnsGeometry { get; }

Property Value

bool

Geometry

The query geometry used to filter results.

IGeometry Geometry { get; set; }

Property Value

IGeometry

Remarks

If a geometry bag is being used as the filter's query geometry, a spatial index should be created for the bag prior to any evaluation using the filter. This can be done by casting the geometry bag to the ISpatialIndex interface, setting the AllowIndexing property to true, and calling the Invalidate method.

Note that at ArcGIS 9.3 and later, setting this property to null will cause an error.

GeometryEx[bool]

bool GeometryEx[bool Geometry] { set; }

Parameters

Geometry bool

Property Value

bool

GeometryField

The name of the Geometry field to which the filter applies.

string GeometryField { get; set; }

Property Value

string

OutputSpatialReference[string]

ISpatialReference OutputSpatialReference[string FieldName] { get; set; }

Parameters

FieldName string

Property Value

ISpatialReference

SearchOrder

The search order used by the filter.

esriSearchOrder SearchOrder { get; set; }

Property Value

esriSearchOrder

Remarks

SearchOrder gets the order in which spatial searches are applied by the RDBMS (ArcSDE). The spatial component of the search should generally be applied before the attribute component. The more spatially restrictive of the two should be used. In the following query, "Find all wells with particulate counts between 1000 and 1200 in within 5 miles of a school", the esriSearchOrderAttribute enumerator is more effective. If the filter geometry is the outline of the city of Modesto, California and the attribute query is "street_name = 'Main St.'" then esriSearchOrderSpatial should be used, as there are a large number of "Main St." records at a national level.

Please note that esriSearchOrderSpatial is the default option.  The following esriSearchOrder enumeration values are used to set the search order:

esriSearchOrderAttribute

Sets the search order to attribute first.

esriSearchOrderSpatial

Sets the search order to spatial first.







SpatialRel

The spatial relationship checked by the filter.

esriSpatialRelEnum SpatialRel { get; set; }

Property Value

esriSpatialRelEnum

SpatialRelDescription

The array elements which describe the spatial relation between the query geometry and the requested geometries. There are 9 chars in this string which can be either 'F', 'T' or ''; e.g., TTFFT***' represents CONTAIN.

string SpatialRelDescription { get; set; }

Property Value

string

Remarks

The SpatialRelDescription allows the comparison of any spatial relationship between two geometries. A spatial relationship is defined by the intersections between the boundary, interior, and exterior of the query geometry and the requested geometry.

All of the spatial relationships defined by the esriSpatialRelEnum enumeration can be duplicated using this property.


Interior:
The interior of a shape is defined as the entire shape minus its boundary. All shapes have interior.

Boundary:
Linear and area shapes have boundaries, but point shapes do not. The boundary of linear shapes consists of the end points of all linear parts. The boundary of area shapes consists of the linear boundary of the polygon shell(s).

Exterior:
The area outside a shape. All shapes have an exterior.







Each element for the first shape, the query geometry, may be tested against each element of the second shape, the requested geometry, giving nine possible spatial intersections as listed in the table below:

Query Geometry Requested Geometry
1 interior interior
2 interior boundary
3 interior exterior
4 boundary interior
5 boundary boundary
6 boundary exterior
7 exterior interior
8 exterior boundary
9 exterior exterior


The nine-characters string expected by ISpatialFilter::SpatialRelDescription, is used to specify whether the intersection of each of the elements in the array is true (T), false (F), or not tested (*).

For instance, in 'FFFTTT***', relationships 1-3 must be false, relationships 4-6 must be true, and relationships 7-9 are not tested.

Note that any two shapes' exteriors always intersect.

Example Strings

Shares a boundary: '****T***'

Shares a boundary and interiors intersect: 'T***T****'

Shares a boundary and interiors do not intersect: 'F***T****'

Does not touch the boundary and interiors intersect: 'T***F****'





Approximate  esriSpatialRelEnum SpatialRelDescription Strings 
Relation Query Geometry Requested Geometry String
Contains Line Line TT*FFT***
Contains Point Line TT*FFT***
Contains Point Point T********
Contains Line Poly TT*FFT***
Contains Poly Poly TT*FFT***
Crosses Line Line TF*FF****
Crosses Poly Line TT**F****
Crosses Line Poly TT**T****
Overlaps Line Line TT*T*****
Overlaps Point Point T********
Overlaps Poly Poly TT*T*****
Touch Line Line FF*FT****
Touch Poly Line FF*FT****
Touch Line Poly FF*FT****
Touch Poly Poly FF*FT****
Within Line Line TF**F****
Within Point Line T********
Within Point Point T********
Within Line Poly TF**F****
Within Poly Poly TF**F****



 

SubFields

string SubFields { get; set; }

Property Value

string

WhereClause

string WhereClause { get; set; }

Property Value

string

Methods

AddField(string)

void AddField(string subField)

Parameters

subField string

set_GeometryEx(IGeometry, bool)

void set_GeometryEx(IGeometry Geometry, bool A_2)

Parameters

Geometry IGeometry
A_2 bool