I had an application which had 5 cm meter accuracy and needed to get points 
with 1 meter for example.
 
I ended up writing my own search method.  I'm sure others are trying to do 
similar.
 
The patch I submitted doesn't change the original code at all unless you enable 
the RTREE_DOUBLE.  So it should be perfectly safe to apply.  Could probably be 
done better but it's isolated right now.
 
Michael D. Black
Senior Scientist
Advanced Analytics Directorate
Northrop Grumman Information Systems
 

________________________________

From: sqlite-users-boun...@sqlite.org on behalf of Richard Hipp
Sent: Thu 11/4/2010 10:49 AM
To: General Discussion of SQLite Database
Subject: EXTERNAL:Re: [sqlite] R*Tree module and double precision?



On Thu, Nov 4, 2010 at 11:27 AM, Ben Harper <b...@imqs.co.za> wrote:

> Are you sure that double precision in the RTree is necessary for your
> purposes?
>

To put this another way, single-precision RTree is sufficient to locate any
point on the surface of the earth to within less than 2.5 meters.  I'm
curious to know what real-world application needs more precision than that?

Remember that R-Tree is intended as a approximation filter to limit the
search space for a query.  It does not normally yield the definitive
answer.  Instead, R-Tree returns a superset of the answer which is further
refined by lower-level constraints.  Within 2.5 meters over the entire
surface of the earth is not a close enough approximation?


>
> Here is a table of floating point precision at various values:
>
> The 'flip' values are the 'org' values with the lowest bit flipped.
>
>             org             flip (    delta)
>            0.01             0.01 ( 0.000000) (lowest bit is 10 ^ -9.030900)
>            0.10             0.10 ( 0.000000) (lowest bit is 10 ^ -8.127810)
>            1.00             1.00 ( 0.000000) (lowest bit is 10 ^ -7.224720)
>           10.00            10.00 ( 0.000001) (lowest bit is 10 ^ -6.020600)
>          100.00           100.00 ( 0.000008) (lowest bit is 10 ^ -5.117510)
>         1000.00          1000.00 ( 0.000061) (lowest bit is 10 ^ -4.214420)
>        10000.00         10000.00 ( 0.000977) (lowest bit is 10 ^ -3.010300)
>        99999.99         99999.98 ( 0.007813) (lowest bit is 10 ^ -2.107210)
>       999999.94        999999.88 ( 0.062500) (lowest bit is 10 ^ -1.204120)
>      9999999.00       9999998.00 ( 1.000000) (lowest bit is 10 ^ 0.000000)
>     99999992.00      99999984.00 ( 8.000000) (lowest bit is 10 ^ 0.903090)
>    999999936.00     999999872.00 (64.000000) (lowest bit is 10 ^ 1.806180)
>
>
> -----Original Message-----
> From: sqlite-users-boun...@sqlite.org [mailto:
> sqlite-users-boun...@sqlite.org] On Behalf Of Black, Michael (IS)
> Sent: 04 November 2010 02:51 PM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] R*Tree module and double precision?
>
> I'll send the patched C file to your email address.  I think the 1M patched
> version is a bit much for the email list.
>
> Normally you would just use the "patch" utility to apply the patch to your
> file.
>
> Michael D. Black
> Senior Scientist
> Advanced Analytics Directorate
> Northrop Grumman Information Systems
>
>
> ________________________________
>
> From: sqlite-users-boun...@sqlite.org on behalf of
> jsarc...@nanotronicsimaging.com
> Sent: Wed 11/3/2010 10:22 AM
> To: sqlite-users@sqlite.org
> Subject: EXTERNAL:Re: [sqlite] R*Tree module and double precision?
>
>
>
> >From: "Black, Michael (IS)" <michael.bla...@ngc.com> I made a patch
> >which seems to do this for you...
> >Use this switch to enable double precision on RTREE /DRTREE_DOUBLE
>
> I am interested in this as well.  Will this patch be included in a future
> version of SQLite?  Or, if not, how best to make use of this patch if I
> normally use the amalgamation from C++.
> Jeff Archer
> Nanotronics Imaging
> jsarc...@nanotronicsimaging.com
> <330>819.4615
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



--
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to