Oihana PHP Arango

geoArea.php

Table of Contents

Functions

geoArea()  : string
Return the area of a GeoJSON Polygon or MultiPolygon, in square meters.

Functions

geoArea()

Return the area of a GeoJSON Polygon or MultiPolygon, in square meters.

geoArea(array<string|int, mixed>|string $geo[, string|null $ellipsoid = null ]) : string

This helper wraps the ArangoDB AQL function GEO_AREA(geoJson, ellipsoid) which computes the area of a polygonal GeoJSON geometry. The optional ellipsoid ("sphere" or "wgs84") selects the reference model.

Example AQL usage:

GEO_AREA(doc.area)
GEO_AREA(doc.area, "wgs84")
Parameters
$geo : array<string|int, mixed>|string

The polygonal GeoJSON geometry (AQL expression or coordinates).

$ellipsoid : string|null = null

Optional reference ellipsoid: "sphere" (default) or "wgs84".

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

$expr = geoArea( 'doc.area' , 'wgs84' );
// Produces: 'GEO_AREA(doc.area,"wgs84")'
see
https://docs.arangodb.com/stable/aql/functions/geo/#geo_area
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results