~ubuntu-branches/ubuntu/wily/sqlite3/wily

« back to all changes in this revision

Viewing changes to www/rtree.html

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2012-06-13 21:43:48 UTC
  • mfrom: (0.34.1) (0.32.2) (9.1.36 sid)
  • Revision ID: package-import@ubuntu.com-20120613214348-2pg18uml05o7h2k5
Tags: 3.7.13-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
results will come back.
331
331
</p>
332
332
 
 
333
<h3>3.3 Roundoff Error</h3>
 
334
 
 
335
<p>
 
336
By default, coordinates are stored in an R*Tree using 32-bit floating
 
337
point values.  When a coordinate cannot be exactly represented by a
 
338
32-bit floating point number, the lower-bound coordinates are rounded down
 
339
and the upper-bound coordinates are rounded up.  Thus, bounding boxes might
 
340
be slightly larger than specified, but will never be any smaller.  This
 
341
is exactly what is desired for doing the more common "overlapping" queries
 
342
where the application wants to find every entry in the R*Tree that overlaps
 
343
a query bounding box.  Rounding the entry bounding boxes outward might cause a
 
344
few extra entries to appears in an overlapping query if the edge of the
 
345
entry bounding box corresponds to an edge of the query bounding box.  But
 
346
the overlapping query will never miss a valid table entry.  
 
347
 
 
348
<p>However, for a "contained-within" style query, rounding the bounding
 
349
boxes outward might cause some entries to be excluded from the result set
 
350
if the edge of the entry bounding box corresponds to the edge of the query
 
351
bounding box.  To guard against this, applications should expand their
 
352
contained-within query boxes slightly (by 0.000012%) by rounding down the
 
353
lower coordinates and rounding up the top coordinates, in each dimension.
 
354
 
333
355
<h2>4.0 Using R*Trees Effectively</h2>
334
356
 
335
357
<p>