Oihana PHP Arango

geoIntersects.php

Table of Contents

Functions

geoIntersects()  : string
Check whether two GeoJSON geometries intersect.

Functions

geoIntersects()

Check whether two GeoJSON geometries intersect.

geoIntersects(array<string|int, mixed>|string $geo1, array<string|int, mixed>|string $geo2) : string

This helper wraps the ArangoDB AQL function GEO_INTERSECTS(geoJsonA, geoJsonB) which returns true when the two geometries share at least one point. Both arguments use the GeoJSON longitude-first convention.

Example AQL usage:

GEO_INTERSECTS(doc.area, @zone)
Parameters
$geo1 : array<string|int, mixed>|string

First GeoJSON geometry (AQL expression or coordinates).

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

Second GeoJSON geometry (AQL expression or coordinates).

Tags
example
use function oihana\arango\db\functions\geo\geoIntersects;

$expr = geoIntersects( 'doc.area' , '@zone' );
// Produces: 'GEO_INTERSECTS(doc.area,@zone)'
see
https://docs.arangodb.com/stable/aql/functions/geo/#geo_intersects
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results