Oihana PHP Arango

geoContains.php

Table of Contents

Functions

geoContains()  : string
Check whether one GeoJSON geometry fully contains another.

Functions

geoContains()

Check whether one GeoJSON geometry fully contains another.

geoContains(array<string|int, mixed>|string $container, array<string|int, mixed>|string $contained) : string

This helper wraps the ArangoDB AQL function GEO_CONTAINS(geoJsonA, geoJsonB) which returns true when geometry B is completely inside geometry A (a point inside a polygon, a polygon inside a larger polygon, …). Both arguments use the GeoJSON longitude-first convention.

Example AQL usage:

GEO_CONTAINS(doc.area, GEO_POINT(2.3522, 48.8566))
Parameters
$container : array<string|int, mixed>|string

The containing GeoJSON geometry (AQL expression or coordinates).

$contained : array<string|int, mixed>|string

The contained GeoJSON geometry (AQL expression or coordinates).

Tags
example
use function oihana\arango\db\functions\geo\geoContains;
use function oihana\arango\db\functions\geo\geoPoint;

$expr = geoContains( 'doc.area' , geoPoint( 48.8566 , 2.3522 ) );
// Produces: 'GEO_CONTAINS(doc.area,GEO_POINT(2.3522,48.8566))'
see
https://docs.arangodb.com/stable/aql/functions/geo/#geo_contains
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results