[postgis-devel] GBOXF

Mark Cave-Ayland mark.cave-ayland at siriusit.co.uk
Tue Nov 29 07:24:59 PST 2011


On 29/11/11 15:10, Sandro Santilli wrote:

>> Indeed. My main argument for using doubles instead of floats is
>> because at the moment, we inflate the bounding box from double to
>> float. This means that we can categorically state that a point
>> *outside* of the float bounding box is definitely not within the
>> real bounding box of the geometry, but we cannot say the inverse,
>> i.e. a point *inside* the float bounding box may or may not within
>> the real bounding box of the geometry.
>
> Your use of "real" seems inappropriate to me.
> Both boxes are "bounding".
> One may be smaller than the other, so could be "closer" to the
> real "minimum bounding box".

In this case I would consider "real" to be a bounding box which 
represented the full precision of underlying data as input by the user, 
and not a cast approximation.

>> My feeling is that if we use floats then we minimise the usefulness
>> of the cache because it reduces the number of use cases that it
>> could be used to optimise (and I'm fairly sure that some functions
>> will assume that the second predicate in the paragraph above is
>> true, and therefore give wrong answers in certain cases).
>
> Would be useful to have a few of these use cases listed here.
> The only one I can think about would be using&&  to really check
> for equality of points.

Another case to think about would be GROUP BY, which works by performing 
an equality comparison between bounding boxes - again, two very similar 
yet distinct geometries could be considered equal.


ATB,

Mark.

-- 
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs



More information about the postgis-devel mailing list