]> granicus.if.org Git - postgis/commitdiff
Fix problem thresholded distance searching in circ-trees. (#1796)
authorPaul Ramsey <pramsey@cleverelephant.ca>
Sun, 1 Jul 2012 14:24:37 +0000 (14:24 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Sun, 1 Jul 2012 14:24:37 +0000 (14:24 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10006 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeodetic_tree.c

index 825f598afc4ac05c21547d8af712df0ee6c1722b..14df95e104ef7ad5d5bc81088f1f1ab9ed0aa04a 100644 (file)
@@ -389,8 +389,9 @@ circ_tree_distance_tree(const CIRC_NODE* n1, const CIRC_NODE* n2, const SPHEROID
        double max_dist = MAXFLOAT;
        GEOGRAPHIC_POINT closest1, closest2;
        double distance1, distance2;
-
-       distance1 = circ_tree_distance_tree_internal(n1, n2, threshold, &min_dist, &max_dist, &closest1, &closest2);
+       double threshold_radians = threshold / spheroid->radius;
+       
+       distance1 = circ_tree_distance_tree_internal(n1, n2, threshold_radians, &min_dist, &max_dist, &closest1, &closest2);
        distance2 = spheroid_distance(&closest1, &closest2, spheroid);
 
        return distance2;