[postgis-devel] Float vs Double Box

Brian Hamlin maplabs at light42.com
Thu Nov 10 23:56:43 PST 2011


Hi Nicklas -

   did you see my slides, exploring the subtle difference in  
st_distance(), <->  , <#>  ?

http://download.osgeo.org/postgis/knn_misc/

==
Brian Hamlin
GeoCal
OSGeo California Chapter
415-717-4462 cell

On Nov 10, 2011, at 11:47 PM, Nicklas Avén wrote:

>
>> Or floats for every box, right ?
>> That should be pretty consistent: box operations are floats,
>> shape operations are double.
>
> No, there will still be problems.
> Look at the example I posted yesterday. When it comes to ordering by
> distance between bboxes you might get the wrong answer.
>
> So nearest neighbor calculations with knn will not be robust
>
> SELECT id, ST_Distance(a, b), a<->b FROM
> (SELECT 1 id, 'POINT(300000 6000000)'::geometry a, 'POINT(300001.0
> 6000001.4)'::geometry b
> UNION ALL
> SELECT 2 id, 'POINT(300000 6000000)'::geometry a, 'POINT(300001.1
> 6000001.1)'::geometry b ) c
> ORDER BY  a<->b
>
> Run it and look at the order of st_distance compared to the order  
> of <->
> Here it is of course without index use, but I guess the result is the
> same with index.
>
> /Nicklas
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>




More information about the postgis-devel mailing list