Skip to content

Commit 3233123

Browse files
committed
Docs: document precision limitations of geo_bounding_box (#30540)
The geo_bounding_box query might produce false positives alongside the right and upper edges and false negatives alongside left and bottom edges. This commit documents the behavior and defines the maximum error. Closes #29196
1 parent f562cd7 commit 3233123

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/reference/query-dsl/geo-bounding-box-query.asciidoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,3 +329,16 @@ and will not match any documents for this query. This can be useful when
329329
querying multiple indexes which might have different mappings. When set to
330330
`false` (the default value) the query will throw an exception if the field
331331
is not mapped.
332+
333+
[float]
334+
==== Notes on Precision
335+
336+
Geopoints have limited precision and are always rounded down during index time.
337+
During the query time, upper boundaries of the bounding boxes are rounded down,
338+
while lower boundaries are rounded up. As a result, the points along on the
339+
lower bounds (bottom and left edges of the bounding box) might not make it into
340+
the bounding box due to the rounding error. At the same time points alongside
341+
the upper bounds (top and right edges) might be selected by the query even if
342+
they are located slightly outside the edge. The rounding error should be less
343+
than 4.20e-8 degrees on the latitude and less than 8.39e-8 degrees on the
344+
longitude, which translates to less than 1cm error even at the equator.

0 commit comments

Comments
 (0)