withinRectangle.php
Table of Contents
Functions
- withinRectangle() : string
- Return documents of a collection within a bounding rectangle (legacy).
Functions
withinRectangle()
Return documents of a collection within a bounding rectangle (legacy).
withinRectangle(string $collection, float|int|string $latitude1, float|int|string $longitude1, float|int|string $latitude2, float|int|string $longitude2) : string
This helper wraps the ArangoDB AQL function WITHIN_RECTANGLE(collection, latitude1, longitude1, latitude2, longitude2) which returns all documents
located inside the rectangle defined by two opposite corners. The collection
must have a geo index. Coordinates are given in the latitude-first order.
This is a legacy function; prefer a geo index combined with GeoJSON geoContains() over a polygon for new code.
Example AQL usage:
FOR place IN WITHIN_RECTANGLE(places, 48.80, 2.25, 48.90, 2.40) RETURN place
Parameters
- $collection : string
-
The target collection name (AQL identifier).
- $latitude1 : float|int|string
-
Latitude of the first corner (or AQL expression).
- $longitude1 : float|int|string
-
Longitude of the first corner (or AQL expression).
- $latitude2 : float|int|string
-
Latitude of the opposite corner (or AQL expression).
- $longitude2 : float|int|string
-
Longitude of the opposite corner (or AQL expression).
Tags
Return values
string —The formatted AQL expression.