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
Name | DataType | List Options | Description |
---|---|---|---|
table | lookup | The target table to search on | |
sourcefield | childitem | The source geolocation data (contains the latitude, longitude, etc) | |
targetfield | string | The field in the target table which contains target's geo location data | |
returncolumn | string | Optional, which field in target to return when a match is found; if omitted, the entire target object is returned | |
radius | int | The default geofence radius |