PostGIS
Description
Returns the 3-dimensional longest line between two geometries. The function returns the first longest line if more than one. The line returned starts in g1 and ends in g2. The 3D length of the line is equal to the distance returned by ST_3DMaxDistance.
Availability: 2.0.0
Changed: 2.2.0 - if 2 2D geometries are input, a 2D point is returned (instead of old behavior assuming 0 for missing Z). In case of 2D and 3D, Z is no longer assumed to be 0 for missing Z.
This function supports 3d and will not drop the z-index.
This function supports Polyhedral surfaces.
Examples
linestring and point — both 3d and 2d longest line
|
lol2d_line_pt -----------------------------------+---------------------------- LINESTRING(50 75 1000,100 100 30) |
LINESTRING(98 190,100 100) ---- |
linestring and multipoint — both 3d and 2d longest line
|
lol2d_line_pt ---------------------------------+-------------------------- LINESTRING(98 190 1,50 74 1000) |
LINESTRING(98 190,50 74) ---- |
MultiLineString and Polygon both 3d and 2d longest line
|
lol2d ------------------------------+-------------------------- LINESTRING(175 150 5,1 10 2) |
LINESTRING(175 150,1 10) ---- |