SqlGeometryBuilder Class
SQL Server 2012
Constructs instances of SqlGeometry objects by using IGeometrySink interface.
Namespace: Microsoft.SqlServer.Types
Assembly: Microsoft.SqlServer.Types (in Microsoft.SqlServer.Types.dll)
The SqlGeometryBuilder type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | AddCircularArc(Double, Double, Double, Double) | Adds a circular arc to the path. |
![]() | AddCircularArc(Double, Double, Nullable<Double>, Nullable<Double>, Double, Double, Nullable<Double>, Nullable<Double>) | Adds a circular arc to the path. |
![]() | AddLine(Double, Double) | Constructs additional points in a geometry type figure. |
![]() | AddLine(Double, Double, Nullable<Double>, Nullable<Double>) | Constructs additional points in the call sequence for a geometry type. |
![]() | BeginFigure(Double, Double) | Starts the call sequence for a geometry figure. |
![]() | BeginFigure(Double, Double, Nullable<Double>, Nullable<Double>) | Starts the call sequence for a geometry figure. |
![]() | BeginGeometry | Initializes a call sequence for a geometry type. |
![]() | EndFigure | Finishes a call sequence for a geometry figure. |
![]() | EndGeometry | Finishes a call sequence for a geometry type. |
![]() | Equals | (Inherited from Object.) |
![]() | Finalize | (Inherited from Object.) |
![]() | GetHashCode | (Inherited from Object.) |
![]() | GetType | (Inherited from Object.) |
![]() | MemberwiseClone | (Inherited from Object.) |
![]() | SetSrid | Sets the Spatial Reference Identifier (SRID) for a geometry type call sequence. |
![]() | ToString | (Inherited from Object.) |
The following example constructs a SqlGeometry object from a MultiLineString.
SqlGeometryBuilder b = new SqlGeometryBuilder();
b.SetSrid(0);
b.BeginGeometry(OpenGisGeometryType.MultiLineString);
b.BeginGeometry(OpenGisGeometryType.LineString);
b.BeginFigure(1, 1);
b.AddLine(3, 4);
b.EndFigure();
b.EndGeometry();
b.BeginGeometry(OpenGisGeometryType.LineString);
b.BeginFigure(-5, -3);
b.AddLine(2, 2);
b.EndFigure();
b.EndGeometry();
b.EndGeometry();
SqlGeometry g = b.ConstructedGeometry();

