]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/NearPoint.php
add tests for nearpoint sql functions
[nominatim.git] / lib / NearPoint.php
index 836e017c374d16e1fd4529f630f5a022a9723e70..16b6dff5276be2ff79f07486fc69cfd9152dd8e2 100644 (file)
@@ -32,6 +32,11 @@ class NearPoint
         return 'ST_Distance('.$this->sSQL.", $sObj)";
     }
 
+    public function withinSQL($sObj)
+    {
+        return sprintf('ST_DWithin(%s, %s, %F)', $sObj, $this->sSQL, $this->fRadius);
+    }
+
     /**
      * Check that the coordinates are valid WSG84 coordinates.
      */