SpatialRectSearch Command

Use the SpatialRectSearch command in a Logic Template to search a spatial index for records containing coordinates that lie within any of the spatial grid rectangles that are touched by the rectangular area being searched. To obtain exact results, the records returned by the search request should then be filtered by the SpatialRectFilter command.

To execute a Search Spatial Index Rectangular request, use the SpatialRectSearch command with five arguments:

SpatialRectSearch( fc, idx, rect, pas, wt );

SpatialRectSearch Arguments

Argument

Description

fc

The function code defining how to merge results.( NONRESTRICTIVE, RESTRICTIVE )

idx

The spatial index to be searched.

rect

The name of the HTML variable containing the coordinates of two diagonally opposing corners of the rectangle.

pas

The pass during which the search is to be executed.

wt

The weighting value to apply to this search. The weighting value may be passed directly or within an HTML variable.

Access the SpatialRectSearch Dialog Box by selecting the Spatial Index->Rectangular menu item under the Searching category of the Logic Template editor command menu.

Examples

Command

Description

SpatialRectSearch( NONRESTRICTIVE, AreaIndex, Rectangle, 1, 4);

Search spatial index named "AreaIndex" during pass 1 with a weighting value of 4. Use the coordinates of the two diagonally opposing corners stored in the HTML variable "Rectangle" to define the rectangle and OR the results with other indexes.

Rectangle = {{43, 55}, {48, 59}};

SpatialRectSearch( RESTRICTIVE, AreaIndex, Rectangle, 3, 0);

Search spatial index named "AreaIndex" during pass 3 without a weighting value. Search for records within a rectangle defined by the two diagonally opposing corners with coordinates { 43, 55 } and { 48, 59 }, and AND the results with other indexes.

IF ( NWcorner && SEcorner )

Rectangle = {NWcorner, SEcorner};

SpatialRectSearch( NONRESTRICTIVE, AreaIndex, Rectangle, 1, Weight);

ENDIF

If the HTML variables "NWcorner" and "SEcorner" are defined, search the spatial index named "AreaIndex" during pass 1 for the rectangle defined by the two HTML variables and OR the results to other indexes using a weighting value stored in the HTML variable "Weight".