Oihana PHP Arango

geoLineString.php

Table of Contents

Functions

geoLineString()  : string
Build a GeoJSON LineString geometry.

Functions

geoLineString()

Build a GeoJSON LineString geometry.

geoLineString(array<string|int, mixed>|string $points) : string

This helper wraps the ArangoDB AQL function GEO_LINESTRING(points) which constructs a valid GeoJSON LineString from an ordered array of [longitude, latitude] pairs, following the GeoJSON longitude-first convention.

Example AQL usage:

GEO_LINESTRING([ [2.35, 48.85], [4.83, 45.76] ])
Parameters
$points : array<string|int, mixed>|string

An array of [longitude, latitude] pairs, or an AQL expression.

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

$expr = geoLineString( [ [ 2.35 , 48.85 ] , [ 4.83 , 45.76 ] ] );
// Produces: 'GEO_LINESTRING([[2.35,48.85],[4.83,45.76]])'
see
https://docs.arangodb.com/stable/aql/functions/geo/#geo_linestring
since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results