]> granicus.if.org Git - postgis/commitdiff
Default to using the tree-based geography distance
authorPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 3 Nov 2017 17:05:40 +0000 (17:05 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Fri, 3 Nov 2017 17:05:40 +0000 (17:05 +0000)
calculation in all cases. (Closes #3528)
As implemented this results in trees being
calculated once more than is absolutely necessary
in the cached case, but changing that involves
re-working all the caching code for geos/geography/intersects
which is non-ideal.

git-svn-id: http://svn.osgeo.org/postgis/trunk@16091 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/geography_measurement.c

index af7fdf471dbdb3092012fb06522b975717279d1a..dc126ab95c99171f0fbbc9c15b3261bda3830e7d 100644 (file)
@@ -243,11 +243,16 @@ Datum geography_distance(PG_FUNCTION_ARGS)
        /* Do the brute force calculation if the cached calculation doesn't tick over */
        if ( LW_FAILURE == geography_distance_cache(fcinfo, g1, g2, &s, &distance) )
        {
+               /* default to using tree-based distance calculation at all times */
+               /* in standard distance call. */
+               geography_tree_distance(g1, g2, &s, FP_TOLERANCE, &distance);
+               /*
                LWGEOM* lwgeom1 = lwgeom_from_gserialized(g1);
                LWGEOM* lwgeom2 = lwgeom_from_gserialized(g2);
                distance = lwgeom_distance_spheroid(lwgeom1, lwgeom2, &s, tolerance);
                lwgeom_free(lwgeom1);
                lwgeom_free(lwgeom2);
+               */
        }
 
        /* Clean up */