ST_NurbsToLineString — Converts a NURBS curve to a LINESTRING by uniform sampling.
geometry ST_NurbsToLineString(geometry nurbscurve, integer num_segments=32);
Converts a NURBS curve to a LINESTRING geometry by creating a piecewise linear approximation. The curve is sampled at uniformly distributed parameter values and the resulting points are connected with straight line segments.
The optional num_segments parameter specifies the number of line segments in the output (default: 32, range: 2-10000). Higher values produce smoother approximations but increase geometry complexity.
Raises an error if the input is not a NURBS curve. Returns NULL if the input is NULL.
Availability: 3.7.0
This example converts a NURBS curve to a LineString using the default quality.
SELECT ST_AsText(ST_NurbsToLineString('NURBSCURVE(2, (0 0, 5 10, 10 0))'::geometry));
This example creates a high-quality approximation with 64 segments.
SELECT ST_AsText(ST_NurbsToLineString('NURBSCURVE(2, (0 0, 5 10, 10 0))'::geometry, 64));
This example creates a lower-quality, faster approximation with 16 segments.
SELECT ST_AsText(ST_NurbsToLineString('NURBSCURVE(2, (0 0, 5 10, 10 0))'::geometry, 16));