--- title: "CG_Distance" draft: false hidden: true ---

Name

CG_Distance — Computes the minimum distance between two geometries

Synopsis

double precision CG_Distance ( geometry geomA , geometry geomB ) ;

Description

Computes the minimum distance between two geometries.

Performed by the SFCGAL module

[Note]

NOTE: this function returns a double precision value representing the distance.

Availability: 3.5.0

This method needs SFCGAL backend.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

Geometry Examples

SELECT CG_Distance('LINESTRING(0.0 0.0,-1.0 -1.0)', 'LINESTRING(3.0 4.0,4.0 5.0)');
        cg_distance
        -------------
        2.0
        (1 row)

See Also

CG_3DDistance , CG_Distance