CG_NurbsCurveInterpolate — Creates an interpolating NURBS curve passing through all given data points
geometry CG_NurbsCurveInterpolate(geometry data_points, integer degree);
Creates a NURBS curve that interpolates through all provided data points. The resulting curve passes exactly through each point in the input geometry.
Parameters:
data_points - A LINESTRING geometry containing the points to interpolate through.
degree - Polynomial degree of the NURBS curve (typically 2 or 3).
Availability: 3.7.0 - requires SFCGAL >= 2.3.0.
This method needs SFCGAL backend.
This function supports 3d and will not drop the z-index.
-- Create a smooth curve interpolating through 5 points
SELECT CG_NurbsCurveInterpolate(
'LINESTRING(0 0, 1 2, 3 3, 5 1, 6 0)'::geometry,
3
);
-- 3D interpolation
SELECT CG_NurbsCurveInterpolate(
'LINESTRING Z(0 0 0, 1 2 1, 3 3 0, 5 1 -1, 6 0 0)'::geometry,
2
);