PrimaryGeoRadialSearch Command

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

Only the PrimaryGeoRadialSearch or the PrimaryGeoRectSearch commands can be used to search a primary geo-spatial index. And, only a primary geo-spatial index should be searched using the PrimaryGeoRadialSearch or the PrimaryGeoRectSearch command.

The results from the search of all primary indexes within a single pass are ORed together, then used to restrict the overall search results from that pass in a highly optimized manner. The restricted results from the current pass are then ORed to the results from all other passes.

To execute a Search Primary Geo-Spatial Index Radial request, use the PrimaryGeoRadialSearch command with five arguments:

PrimaryGeoRadialSearch( idx, cntr, rad, pas, unts );

PrmaryGeoRadialSearch Arguments

Argument

Description

idx

The primary geo-spatial index to be searched.

cntr

The name of the HTML variable containing the coordinates of the center of the circle.

rad

The name of the HTML variable containing the radius of the circle.

pas

The pass during which the search is to be executed.

unts

Determines the units to be used ( MILES or KILOMETERS ) for the radius rad.

Access the PrimaryGeoRadialSearch Dialog Box by selecting the Geo-Spatial Index->Primary Radial menu item under the Searching category of the Logic Template editor command menu.

Examples

Command

Description

PrimaryGeoRadialSearch( AreaIndex, Center, Radius, 1, MILES);

Search primary geo-spatial index named "AreaIndex" during pass 1. Use the coordinates stored in the HTML variable "Center" as the center and the value stored in HTML variable "Radius" as the radius with the units in miles, and OR the results with other indexes.

Center = { -82.232, 29.233 };

Radius = 25;

PrimaryGeoRadialSearch( AreaIndex, Center, Radius, 3, KILOS);

Search primary geo-spatial index named "AreaIndex" during pass 3. Use coordinates -82.232° and 29.233° as the center and the value 25 kilometers as the radius and AND the results with other indexes.

IF ( Radius && Center )

PrimaryGeoRadialSearch( AreaIndex, Center, Radius, 1, MILES );

ENDIF

If the HTML variable "Radius" contains something other than zero and the HTML variable "Center" contains a pair of coordinates, search the primary geo-spatial index named "AreaIndex" during pass 1 for the circle defined by the HTML variables "Center" and "Radius" with the units in miles, and OR the results to other indexes.