ST_DISTANCE_SPHERE

You are viewing an old version of this article. View the current version here.

Syntax

ST_DISTANCE_SPHERE(g1,g2,r)

Description

Returns the distance on sphere between two geometries (point or multipoint) in the radius r (default is the Earth radius), or null if not given valid inputs.

Example

set @zenica   = ST_GeomFromText('POINT(17.907743 44.203438)');
set @sarajevo = ST_GeomFromText('POINT(18.413076 43.856258)');
SELECT ST_Distance_Sphere(@zenica, @sarajevo);
55878.59337591705

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.