SqlGeometryBuilder Class

Constructs instances of SqlGeometry objects by using IGeometrySink interface.

Inheritance Hierarchy

System.Object
  Microsoft.SqlServer.Types.SqlGeometryBuilder

Namespace:  Microsoft.SqlServer.Types
Assembly:  Microsoft.SqlServer.Types (in Microsoft.SqlServer.Types.dll)

Syntax

'Declaration
<CLSCompliantAttribute(True)> _
Public Class SqlGeometryBuilder _
    Implements IGeometrySink110, IGeometrySink
'Usage
Dim instance As SqlGeometryBuilder
[CLSCompliantAttribute(true)]
public class SqlGeometryBuilder : IGeometrySink110, 
    IGeometrySink
[CLSCompliantAttribute(true)]
public ref class SqlGeometryBuilder : IGeometrySink110, 
    IGeometrySink
[<CLSCompliantAttribute(true)>]
type SqlGeometryBuilder =  
    class
        interface IGeometrySink110
        interface IGeometrySink
    end
public class SqlGeometryBuilder implements IGeometrySink110, IGeometrySink

The SqlGeometryBuilder type exposes the following members.

Constructors

  Name Description
Public method SqlGeometryBuilder Constructs a SqlGeometryBuilder object.

Top

Properties

  Name Description
Public property ConstructedGeometry Retrieves constructed spatial geometry object.

Top

Methods

  Name Description
Public method AddCircularArc(Double, Double, Double, Double) Adds a circular arc to the path.
Public method AddCircularArc(Double, Double, Nullable<Double>, Nullable<Double>, Double, Double, Nullable<Double>, Nullable<Double>) Adds a circular arc to the path.
Public method AddLine(Double, Double) Constructs additional points in a geometry type figure.
Public method AddLine(Double, Double, Nullable<Double>, Nullable<Double>) Constructs additional points in the call sequence for a geometry type.
Public method BeginFigure(Double, Double) Starts the call sequence for a geometry figure.
Public method BeginFigure(Double, Double, Nullable<Double>, Nullable<Double>) Starts the call sequence for a geometry figure.
Public method BeginGeometry Initializes a call sequence for a geometry type.
Public method EndFigure Finishes a call sequence for a geometry figure.
Public method EndGeometry Finishes a call sequence for a geometry type.
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method SetSrid Sets the Spatial Reference Identifier (SRID) for a geometry type call sequence.
Public method ToString (Inherited from Object.)

Top

Remarks

Throws FormatException for an invalid call sequence or when a call sequence is incomplete when ConstructedGeometry() is invoked.

Examples

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();

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.SqlServer.Types Namespace