mirror of https://gitee.com/bigwinds/arangodb
28 lines
1.7 KiB
Plaintext
28 lines
1.7 KiB
Plaintext
!CHAPTER Geo functions
|
|
|
|
AQL offers the following functions to filter data based on [geo indexes](../Glossary/README.html#geo_index):
|
|
|
|
- *NEAR(collection, latitude, longitude, limit, distancename)*:
|
|
Returns at most *limit* documents from collection *collection* that are near
|
|
*latitude* and *longitude*. The result contains at most *limit* documents, returned in
|
|
any order. If more than *limit* documents qualify, it is undefined which of the qualifying
|
|
documents are returned. Optionally, the distances between the specified coordinate
|
|
(*latitude* and *longitude*) and the document coordinates can be returned as well.
|
|
To make use of that, an attribute name for the distance result has to be specified in
|
|
the *distancename* argument. The result documents will contain the distance value in
|
|
an attribute of that name.
|
|
*limit* is an optional parameter since ArangoDB 1.3. If it is not specified or null, a limit
|
|
value of 100 will be applied.
|
|
|
|
- *WITHIN(collection, latitude, longitude, radius, distancename)*:
|
|
Returns all documents from collection *collection* that are within a radius of
|
|
*radius* around that specified coordinate (*latitude* and *longitude*). The order
|
|
in which the result documents are returned is undefined. Optionally, the distance between the
|
|
coordinate and the document coordinates can be returned as well.
|
|
To make use of that, an attribute name for the distance result has to be specified in
|
|
the *distancename* argument. The result documents will contain the distance value in
|
|
an attribute of that name.
|
|
|
|
Note: these functions require the collection *collection* to have at least
|
|
one geo index. If no geo index can be found, calling this function will fail
|
|
with an error. |