From: Paul Ramsey Date: Fri, 3 Nov 2017 17:05:40 +0000 (+0000) Subject: Default to using the tree-based geography distance X-Git-Tag: 2.5.0alpha~321 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68524cbacb87d691c1d0fd02905e3f4d55e57327;p=postgis Default to using the tree-based geography distance 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 --- diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index af7fdf471..dc126ab95 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -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 */