Name

ST_Degree — Returns the polynomial degree of a NURBS curve.

Synopsis

integer ST_Degree(geometry nurbscurve);

描述

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

示例

This example returns the degree of a NURBS curve.

SELECT ST_Degree('NURBSCURVE(2, (0 0, 5 10, 10 0))'::geometry);
2

This example checks whether a NURBS curve is cubic.

SELECT ST_Degree('NURBSCURVE(3, (0 0, 2 5, 5 8, 10 0))'::geometry) = 3;
t