geo_dist_match

geo_dist_match(str fieldname, float thresh)allows comparison between fields that contain GEO coordinates. The function returns True if the distance between the coordinates is smaller than thresh, and False otherwise.

Input

  • fieldname (str) - the name of the field to match in query document and database document. params[fieldname] and doc[fieldname] must be of type tuple(float)

  • thresh(float) - the distance threshold

Output

  • (Boolean) - True if geo_distance(doc[fieldname],params[fieldname]) < thresh, and False otherwise.

Example:

if geo_dist_match("geolocation", 45.02):
   score = 1.0

Last updated

#108: Max's Nov 6 changes

Change request updated