Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SqlGeometryBuilder Class

Constructs instances of SqlGeometry objects by using IGeometrySink interface.

System.Object
  Microsoft.SqlServer.Types.SqlGeometryBuilder

Namespace:  Microsoft.SqlServer.Types
Assembly:  Microsoft.SqlServer.Types (in Microsoft.SqlServer.Types.dll)
[CLSCompliantAttribute(true)]
public class SqlGeometryBuilder : IGeometrySink

The SqlGeometryBuilder type exposes the following members.

  NameDescription
Public methodSqlGeometryBuilderConstructs a SqlGeometryBuilder object.
Top
  NameDescription
Public propertyConstructedGeometryRetrieves constructed spatial geometry object.
Top
  NameDescription
Public methodAddLine(Double, Double)Constructs additional points in a geometry type figure.
Public methodAddLine(Double, Double, Nullable<Double>, Nullable<Double>)Constructs additional points in the call sequence for a geometry type.
Public methodBeginFigure(Double, Double)Starts the call sequence for a geometry figure.
Public methodBeginFigure(Double, Double, Nullable<Double>, Nullable<Double>)Starts the call sequence for a geometry figure.
Public methodBeginGeometryInitializes a call sequence for a geometry type.
Public methodEndFigureFinishes a call sequence for a geometry figure.
Public methodEndGeometryFinishes a call sequence for a geometry type.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodSetSridSets the Spatial Reference Identifier (SRID) for a geometry type call sequence.
Public methodToString (Inherited from Object.)
Top

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

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.