Oihana PHP Arango

geoEquals.php

Table of Contents

Functions

geoEquals()  : string
Check whether two GeoJSON geometries are equal.

Functions

geoEquals()

Check whether two GeoJSON geometries are equal.

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

This helper wraps the ArangoDB AQL function GEO_EQUALS(geoJsonA, geoJsonB) which returns true when both geometries describe the same shape. Both arguments use the GeoJSON longitude-first convention.

Example AQL usage:

GEO_EQUALS(doc.geo, GEO_POINT(2.3522, 48.8566))
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\geoEquals;

$expr = geoEquals( 'doc.geo' , '@target' );
// Produces: 'GEO_EQUALS(doc.geo,@target)'
see
https://docs.arangodb.com/stable/aql/functions/geo/#geo_equals
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results