ST_3DInterpolatePoint
Name
ST_3DInterpolatePoint — Returns the interpolated measure of a geometry closest to a point in 3D.
Synopsis
float8
ST_3DInterpolatePoint
(
geometry
linear_geom_with_measure
, geometry
point
)
;
Description
Returns the interpolated measure value of a linear ZM geometry at the location closest to the given point, using 3D (XYZ) distance for the projection. Use this function when the geometry has significant Z variation, such as flight trajectories, where ST_InterpolatePoint would give incorrect results by ignoring the Z dimension.
|
|
|
The line must have both Z and M dimensions. The point should have a Z dimension. |
Availability: 3.7.0
This function supports 3d and will not drop the z-index.
Examples
This example interpolates on a line rising diagonally in Z, using a point at the 3D midpoint.
SELECT ST_3DInterpolatePoint( 'LINESTRING ZM (0 0 0 0,10 0 10 20)', 'POINT Z (5 0 5)');
10
This example uses a vertical line with zero XY extent, where 3D projection works but 2D projection does not.
SELECT ST_3DInterpolatePoint( 'LINESTRING ZM (0 0 0 0,0 0 10 100)', 'POINT Z (5 5 5)');
50
See Also
ST_InterpolatePoint , ST_AddMeasure , ST_LocateAlong , ST_LocateBetween