Skip to content

Commit

Permalink
Docs: document precision limitations of geo_bounding_box (#30540)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
imotov committed May 14, 2018
1 parent dce4b46 commit ab80244
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/reference/query-dsl/geo-bounding-box-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,16 @@ and will not match any documents for this query. This can be useful when
querying multiple indexes which might have different mappings. When set to
`false` (the default value) the query will throw an exception if the field
is not mapped.

[float]
==== Notes on Precision

Geopoints have limited precision and are always rounded down during index time.
During the query time, upper boundaries of the bounding boxes are rounded down,
while lower boundaries are rounded up. As a result, the points along on the
lower bounds (bottom and left edges of the bounding box) might not make it into
the bounding box due to the rounding error. At the same time points alongside
the upper bounds (top and right edges) might be selected by the query even if
they are located slightly outside the edge. The rounding error should be less
than 4.20e-8 degrees on the latitude and less than 8.39e-8 degrees on the
longitude, which translates to less than 1cm error even at the equator.

0 comments on commit ab80244

Please sign in to comment.