public static GeometryType Convert(SqlTypes.OpenGisGeographyType type) { switch (type) { case SqlTypes.OpenGisGeographyType.GeometryCollection: return GeometryType.GeometryCollection; case SqlTypes.OpenGisGeographyType.LineString: return GeometryType.LineString; case SqlTypes.OpenGisGeographyType.MultiLineString: return GeometryType.MultiLineString; case SqlTypes.OpenGisGeographyType.MultiPoint: return GeometryType.MultiPoint; case SqlTypes.OpenGisGeographyType.MultiPolygon: return GeometryType.MultiPolygon; case SqlTypes.OpenGisGeographyType.Point: return GeometryType.Point; case SqlTypes.OpenGisGeographyType.Polygon: return GeometryType.Polygon; } throw new NotSupportedException( string.Format( CultureInfo.CurrentCulture, SR.UnsupportedGeometryTypeException, type ) ); }
internal SqlGeography(SqlTypes.SqlGeography sg, ICoordinateSystem coordinateSystem) { Debug.Assert(sg!=null); if (sg==null) throw new ArgumentNullException("sg"); _Geography=sg; _CoordinateSystem=coordinateSystem; }
/// <summary>Creates a new instance of the <see cref="SqlGeometry" /> class.</summary> public SqlGeography(SqlTypes.SqlGeography sg) : this(sg, null) { }
public void BeginGeography(SqlTypes.OpenGisGeographyType type) { _Sink.BeginGeometry(GeometryTypeUtils.Convert(type)); }
/// <summary>Creates a new instance of the <see cref="SqlGeometry" /> class.</summary> public SqlGeometry(SqlTypes.SqlGeometry sg): this(sg, null) { }
void SqlTypes.IGeometrySink.BeginGeometry(SqlTypes.OpenGisGeometryType type) { BeginGeometry(GeometryTypeUtils.Convert(type)); }