[postgis-devel] Float vs Double Box

Sandro Santilli strk at keybit.net
Thu Nov 10 22:07:55 PST 2011


On Thu, Nov 10, 2011 at 04:05:03PM +0000, Mark Cave-Ayland wrote:
> On 09/11/11 20:09, Nicklas Avén wrote:
> 
> >Another aspect of double vs float is that the float boxes might give
> >wrong ordering from knn-gist.
> >
> >In other cases we can round the float box up to a slightly bigger box,
> >but in the ordering case that will not help.
> >
> >That is why we get different answer from native Postgresql knn and
> >PostGIS as I discussed the other week, because Postgresql is not using
> >the bbox but the point itself. I'm I right or have I misunderstood?
> 
> Yes indeed, this was the reason I was suggesting that we should be
> using doubles for everything - coordinates, internal BBOXes and the
> index. Otherwise we find ourselves in situations where queries can
> return different results depending upon whether either a sequential
> scan or an index scan is used, or whether the geometry has an
> internal BBOX or not :(

Or floats for every box, right ?
That should be pretty consistent: box operations are floats,
shape operations are double.

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-devel mailing list