Name

ST_Degree — Returns the polynomial degree of a NURBS curve.

Synopsis

integer ST_Degree(geometry nurbscurve);

Beskrivning

Returns the polynomial degree of a NURBS curve as an integer. The degree determines the curve's smoothness and flexibility. Higher degrees produce smoother curves but require more control points.

The function raises an error if the input is not a NURBS curve. Returns NULL if the input is NULL.

Availability: 3.7.0

Exempel

-- Get the degree of a NURBS curve
SELECT ST_Degree('NURBSCURVE(2, (0 0, 5 10, 10 0))'::geometry);
-- Result: 2

-- Check if a NURBS curve is cubic
SELECT ST_Degree('NURBSCURVE(3, (0 0, 2 5, 5 8, 10 0))'::geometry) = 3;
-- Result: true