コード例 #1
0
        /// <summary>Starts the call sequence for the specified <see cref="GeometryType" />.</summary>
        /// <param name="type">The type of the geometry to build.</param>
        public override void BeginGeometry(GeometryType type)
        {
            if (_Geometry != null)
            {
                _Geometry.BeginGeometry(type);
                return;
            }

            switch (type)
            {
            case GeometryType.GeometryCollection:
                _Geometry = new MultiGeometry();
                break;

            case GeometryType.LineString:
                _Geometry = new LineString();
                break;

            case GeometryType.MultiLineString:
                _Geometry = new MultiLineString();
                break;

            case GeometryType.MultiPoint:
                _Geometry = new MultiPoint();
                break;

            case GeometryType.MultiPolygon:
                _Geometry = new MultiPolygon();
                break;

            case GeometryType.Point:
                _Geometry = new Point();
                break;

            case GeometryType.Polygon:
                _Geometry = new Polygon();
                break;
            }

            if (_Geometry == null)
            {
                throw new NotSupportedException(
                          string.Format(
                              CultureInfo.CurrentCulture,
                              SR.UnsupportedGeometryTypeException,
                              type
                              )
                          );
            }

            _Geometry.CoordinateSystem = TargetSystem;
        }
コード例 #2
0
        /// <summary>Starts the call sequence for the specified <see cref="GeometryType" />.</summary>
        /// <param name="type">The type of the geometry to build.</param>
        public override void BeginGeometry(GeometryType type)
        {
            if (_Geometry!=null)
            {
                _Geometry.BeginGeometry(type);
                return;
            }

            switch (type)
            {
            case GeometryType.GeometryCollection:
                _Geometry=new MultiGeometry();
                break;
            case GeometryType.LineString:
                _Geometry=new LineString();
                break;
            case GeometryType.MultiLineString:
                _Geometry=new MultiLineString();
                break;
            case GeometryType.MultiPoint:
                _Geometry=new MultiPoint();
                break;
            case GeometryType.MultiPolygon:
                _Geometry=new MultiPolygon();
                break;
            case GeometryType.Point:
                _Geometry=new Point();
                break;
            case GeometryType.Polygon:
                _Geometry=new Polygon();
                break;
            }

            if (_Geometry==null)
                throw new NotSupportedException(
                    string.Format(
                        CultureInfo.CurrentCulture,
                        SR.UnsupportedGeometryTypeException,
                        type
                    )
                );

            _Geometry.CoordinateSystem=TargetSystem;
        }