Esempio n. 1
0
        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
                )
            );
        }
Esempio n. 2
0
        internal SqlGeography(SqlTypes.SqlGeography sg, ICoordinateSystem coordinateSystem)
        {
            Debug.Assert(sg!=null);
            if (sg==null)
                throw new ArgumentNullException("sg");

            _Geography=sg;
            _CoordinateSystem=coordinateSystem;
        }
Esempio n. 3
0
 /// <summary>Creates a new instance of the <see cref="SqlGeometry" /> class.</summary>
 public SqlGeography(SqlTypes.SqlGeography sg) :
     this(sg, null)
 {
 }
Esempio n. 4
0
 public void BeginGeography(SqlTypes.OpenGisGeographyType type)
 {
     _Sink.BeginGeometry(GeometryTypeUtils.Convert(type));
 }
Esempio n. 5
0
 /// <summary>Creates a new instance of the <see cref="SqlGeometry" /> class.</summary>
 public SqlGeometry(SqlTypes.SqlGeometry sg):
     this(sg, null)
 {
 }
Esempio n. 6
0
 void SqlTypes.IGeometrySink.BeginGeometry(SqlTypes.OpenGisGeometryType type)
 {
     BeginGeometry(GeometryTypeUtils.Convert(type));
 }