GeoSpatialSort Command

Use the GeoSpatialSort command in a Logic Template to sort results by distance from a defined coordinate pair, using a pair of fields containing numeric values. The values are assumed to be signed integers or fixed point data with an implied decimal point.

Integer values stored within a numeric field must be greater than -4294967296 and less than 4294967296. Values greater than or equal to 4294967296 will be treated as negative. Fixed point data with 2 implied decimal places must be greater than -42949672.96 and less than 42949672.96. The limits for fixed point data with other than 2 implied decimal places is adjusted in the same way by moving the decimal point.

To execute a Geo-Spatial Sort request, use the GeoSpatialSort command with four arguments:

GeoSpatialSort( lon, lat, loc, pas );

GeoSpatialSort Arguments

Argument

Description

lon

The name of the data field containing the longitude for the record being tested.

lat

The name of the data field containing the latitude for the record being tested.

loc

The name of the HTML variable containing the geo-spatial coordinate pair for the center.

pas

The pass during which the sort is to be executed.

Access the GeoSpatialSort Dialog Box by selecting the Geo-Spatial menu item under the Sorting category of the Logic Template editor command menu.

Examples

Command

Description

Center = { -87.347, 34.117 };

GeoSpatialSort( _Field_X, _Field_Y, Center, 2);

Sort results by distance from the point with Longitude -87.347 and Latitude 34.117 during pass 2. Use data coordinates stored in fields "_Field_X" and "_Field_Y".

IF ( Center )

 GeoSpatialSort( _Field_X, _Field_Y, Center, 1);

ENDIF

Sort results by distance from the point with coordinates stored in HTML variable "Center" during pass 1, if "Center" is not empty. Use data coordinates stored in fields "_Field_X" and "_Field_Y".