SpatialRectFilter Command

Use the SpatialRectFilter command in a Logic Template to filter out records that lie on or outside the perimeter of a rectangle.

When dealing with large amounts of data it is often more efficient to use a spatial index to narrow the search. The SpatialRectFilter command can then be used to fine tune the result set.

To execute a Spatial Rectangle Filter request, use the SpatialRectFilter command with four or five arguments:

SpatialRectFilter( bd, dx, dy, box ); or SpatialRectFilter( bd, dx, dy, box, flag );

SpatialRectFilter Arguments

Argument

Description

bd

Indicates how the boundary of the circle are handled.

dx

The name of the data field containing the X coordinate to be tested.

dy

The name of the data field containing the Y coordinate to be tested.

box

The name of the HTML variable containing the rectangle definition.

flag

Indicate ( drop or keep ) special processing for records with a value of zero for both dx and dy.

Access the SpatialRectFilter Dialog Box by selecting Spatial->Rectangle menu item under the Filtering category of the Logic Template editor command menu.

Examples

Command

Description

Rectangle = {{ X_1, Y_1},{ X_2, Y_2}};

SpatialRectFilter( INCLUDE, PointX, PointY, Rectangle);

Pass records containing, in the fields named "PointX" and "PointY", coordinates that lie on or within the rectangle with diagonal corners at the coordinates stored in HTML variable pairs "X_1", "Y_1" and "X_2", "Y_2".

Rectangle = {{ X_1, Y_1},{ X_2, Y_2}};

SpatialRectFilter( INCLUDE, PointX, PointY, Rectangle, keep);

Pass records containing, in the fields named "PointX" and "PointY", either a pair of zeros or coordinates that lie on or within the rectangle with diagonal corners at the coordinates stored in HTML variable pairs "X_1", "Y_1" and "X_2", "Y_2".