[postgis-devel] GBOXF

Mateusz Łoskot mateusz at loskot.net
Thu Dec 1 07:08:08 PST 2011


On 1 December 2011 13:18, Sandro Santilli <strk at keybit.net> wrote:
> On Thu, Dec 01, 2011 at 10:46:25AM +0000, Mark Cave-Ayland wrote:
>
>> What is more concerning is that at the moment we will always be
>> introducing error into geometry bounding box comparisons that are
>> used as part of an index scan, because we need to inflate the box
>> upon conversion from double to float. So at the moment the only way
>> to guarantee consistent results is to use floats for all internal
>> arithmetic - otherwise we will have cases where sequential scans and
>> index scans can return different results.
>
> Note that using floats for all math might not be the same
> as using doubles and then inflate-to-float as the former
> may result in a box which doesn't fully enclose a geometry
> in double precision space.

Plus, float-point arithmetic error accumulates faster for float
than for double.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
Member of ACCU, http://accu.org



More information about the postgis-devel mailing list