Export (0) Print
Expand All

SqlGeographyBuilder Class

Constructs instances of SqlGeography objects by using IGeographySink interface.

Object
  Microsoft.SqlServer.Types.SqlGeographyBuilder

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

public class SqlGeographyBuilder implements IGeographySink110, IGeographySink

The SqlGeographyBuilder type exposes the following members.

  NameDescription
Public methodSqlGeographyBuilderConstructs a SqlGeographyBuilder object.
Top

  NameDescription
Public propertyConstructedGeographyRetrieves the constructed spatial geography object.
Top

  NameDescription
Public methodAddCircularArc(Double, Double, Double, Double)Adds a circular arc to the path.
Public methodAddCircularArc(Double, Double, Nullable(Double), Nullable(Double), Double, Double, Nullable(Double), Nullable(Double))Adds a circular arc to the path.
Public methodAddLine(Double, Double)Constructs additional points in a geography type figure.
Public methodAddLine(Double, Double, Nullable(Double), Nullable(Double))Constructs additional points in a geography type figure.
Public methodBeginFigure(Double, Double)Starts the call sequence for a geography figure.
Public methodBeginFigure(Double, Double, Nullable(Double), Nullable(Double))Starts the call sequence for a geography figure.
Public methodBeginGeographyInitializes a call sequence for a geography type.
Public methodEndFigureFinishes a call sequence for a geography figure.
Public methodEndGeographyFinishes a call sequence for a geography 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 geography type call sequence.
Public methodToString (Inherited from Object.)
Top

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

The following example constructs a SqlGeometry object from a MultiLineString.

SqlGeographyBuilder b = new SqlGeographyBuilder();

b.SetSrid(4326);

b.BeginGeography(OpenGisGeographyType.MultiLineString);

b.BeginGeography(OpenGisGeographyType.LineString);

b.BeginFigure(-122.358, 47.653);

b.AddLine(-122.348, 47.649);

b.EndFigure();

b.EndGeography();

b.BeginGeography(OpenGisGeographyType.LineString);

b.BeginFigure(-118.481, 48.328);

b.AddLine(-119.002, 47.324);

b.EndFigure();

b.EndGeography();

b.EndGeography();

SqlGeography g = b.ConstructedGeography();

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

Community Additions

ADD
Show:
© 2014 Microsoft