g_distance()
returns the distance between two geometries or -1
if an
error occurs. Returns the shortest distance between the two geometries.
The distance is expressed into the same unit as the coordinates of the
geometries.
Note
Geometry validity is not checked. In case you are unsure of the validity
of the input geometries, call g_is_valid()
before, otherwise the result
might be wrong.