From: Paul Ramsey Date: Wed, 5 Jun 2013 21:01:48 +0000 (+0000) Subject: #2168, ST_Distance is not always commutative X-Git-Tag: 2.1.0beta3~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=193f790857454a6a2115255222a835d6089b028f;p=postgis #2168, ST_Distance is not always commutative git-svn-id: http://svn.osgeo.org/postgis/trunk@11530 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/NEWS b/NEWS index 491223172..97f8e023b 100644 --- a/NEWS +++ b/NEWS @@ -185,6 +185,7 @@ PostGIS 2.1.0 - #2100, ST_AsRaster may not return raster with specified pixel type - #2126, Better handling of empty rasters from ST_ConvexHull() - #2165, ST_NumPoints regression failure with CircularString + - #2168, ST_Distance is not always commutative - #2182, Fix issue with outdb rasters with no SRID and ST_Resize - #2188, Fix function parameter value overflow that caused problems when copying data from a GDAL dataset diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index 952ddefe5..5dec9ffc3 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -169,6 +169,9 @@ Datum geography_distance(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } + /* Knock off any funny business at the micrometer level, ticket #2168 */ + distance = round(distance * 10e8) / 10e8; + PG_RETURN_FLOAT8(distance); }