Returns the distance between two ST_Geometry values. ST_3DDistance considers z coordinate values, if they exist in the geometries passed to it.
Argument … |
Specifies … |
ageometry |
the other ST_Geometry value. |
Returns a FLOAT value. The distance units are those of the two input geometries.
Returns 0 if the two geometries intersect.
Returns NULL if the ageometry argument is NULL.
ST_Point, ST_MultiPoint, ST_LineString, and ST_MultiLineString
To be valid with ST_3DDistance, these shapes must include z coordinates.
... WHERE geom.ST_3DDistance(otherGeom) < 10
... WHERE 10 >= geom.ST_3DDistance(otherGeom)
INSERT INTO sample_shapes VALUES(1,'Point(10 20 30)');
INSERT INTO sample_shapes VALUES(2,
'MultiPoint((10 20 30),(40 50 60), (70 80 80))');
INSERT INTO sample_shapes VALUES(3,
'Linestring(10 20 30,40 50 60, 70 80 80)');
INSERT INTO sample_shapes VALUES(4,
'MultiLinestring((10 20 30,40 50 60), (70 80 80, 90 100 110))');
SELECT skey
FROM sample_shapes
WHERE shape.ST_3DDistance('POINT(10 20 30)') < 1E0;