public void EndGeometry()
            {
                GeometryType type = _CurrentType.Peek();

                switch (type)
                {
                case GeometryType.Polygon:
                    if (_Figures.Count > 0)
                    {
                        var g = new SmGeometries.Polygon(
                            (SmGeometries.LinearRing)_Figures[0],
                            _Figures.Skip(1).Cast <SmGeometries.LinearRing>().ToList <SmGeometries.LinearRing>()
                            );
                        _Figures = new SmGeometries.Geometry[] { g };
                    }
                    else
                    {
                        _Figures = new SmGeometries.Geometry[] { new SmGeometries.Polygon() }
                    };
                    break;
                }

                _CurrentType.Pop();

                if (_CurrentType.Count == 0)
                {
                    _Figures[0].SpatialReference = CoordinateSystemUtils.Convert(_SpatialReference);
                }
            }
        /// <summary>Returns the geometry defined by the specified WKB representation, in the specified coordinate system.</summary>
        /// <param name="data">The WKB representation of the geometry.</param>
        /// <param name="system">The coordinate system of the WKB representation.</param>
        public void Parse(byte[] data, ICoordinateSystem system)
        {
            Debug.Assert(system != null);
            if (system == null)
            {
                throw new ArgumentNullException("system");
            }

            var g = SmGeometries.Geometry.GeomFromWKB(data);

            g.SpatialReference = CoordinateSystemUtils.Convert(system);

            if ((TargetSystem != null) && !system.IsEquivalentTo(TargetSystem))
            {
                _Geometry = null;
                var orig = new SharpGeometry(g);
                orig.Populate(this);
            }
            else
            {
                _Geometry = new SharpGeometry(g);
            }
        }