Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt

Use this file to discover all available pages before exploring further.

Calculates and returns the length value representing the maximum distance between any two points across the input geometries. This function is an alias for ST_LongestDistance. ST_MaxDistance

Signatures

ST_MaxDistance(geom1: Geometry, geom2: Geometry)

Parameters

geom1
Geometry
required
The geom1 value.
geom2
Geometry
required
The geom2 value.

Return type

A numeric value.

Example

SELECT ST_MaxDistance(
        ST_GeomFromText("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))"),
        ST_GeomFromText("POLYGON ((10 20, 30 30, 40 20, 30 10, 10 20))")
)
36.05551275463989