geometry.CurveToLineWithTolerance
spatial method CurveToLineWithTolerance (instance.CurveToLineWithTolerance(...))
What changes
- Input
- spatial instance (and arguments)
- Output or change
- geometry
- Return type
- SQL Server return type: geometry CLR return type: SqlGeometry
Syntax at a glance
.CurveToLineWithTolerance ( tolerance, relative )
Work example
Use geometry.CurveToLineWithTolerance to linearize curved segments for a consumer that needs straight edges.
Choose tolerance for the output scale and preserve the original for precise work. Keep the geometry type and SRID in the review.
Check your work The circular arc becomes straight segments with an absolute 0.1-unit tolerance.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
-- Planar geometry. SRID 0 coordinates here are synthetic units, not metres.
DECLARE @shape geometry;
SET @shape = geometry::STGeomFromText(N'CIRCULARSTRING(0 0, 2 2, 4 0)', 0);
SELECT @shape.CurveToLineWithTolerance(0.1, 0).STAsText() AS linearized_curve,
@shape.STSrid AS source_srid,
@shape.STIsValid() AS source_is_valid;
Open Microsoft Learn for full syntax, permissions, and details for your version.