Skip to main content

FIND_BY_GEO

Find the best fit match to a geo location, such as a list of store or job locations. Uses the Great Circle Distance formula to calculate the surface distance between points.

Example Usage

FIND_BY_GEO(Locations, GeoLocation, GeoLocation, )  # search Locations.GeoLocation and return the Location object
FIND_BY_GEO(Projects, , , Code, 100) # search Projects using a 100m radius and return the Project.Code
FIND_BY_GEO(ServiceTickets) # search ServiceTickets using all defaults

Overview

Function signature
FIND_BY_GEO(table, sourcefield, targetfield, returncolumn, radius)

Category
Database

Return data type
None

Arguments

NameDataTypeList Options                          Description
tablelookupThe target table to search on
sourcefieldchilditemThe source geolocation data (contains the latitude, longitude, etc)
targetfieldstringThe field in the target table which contains target's geo location data
returncolumnstringOptional, which field in target to return when a match is found; if omitted, the entire target object is returned
radiusintThe default geofence radius