コード例 #1
0
        /// <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 = Factory.CreateGeometryFromWkb(data);

            if ((TargetSystem != null) && !system.IsEquivalentTo(TargetSystem))
            {
                if (_Geometry != null)
                {
                    _Geometry.Dispose();
                    _Geometry = null;
                }
                using (var orig = new FdoGeometry(g, system))
                    orig.Populate(this);
            }
            else
            {
                _Geometry = new FdoGeometry(g, system);
            }
        }
コード例 #2
0
        /// <summary>Parses the geometry defined by the specified WKT representation, in the specified coordinate system.</summary>
        /// <param name="text">The WKT representation of the geometry.</param>
        /// <param name="system">The coordinate system of the WKT representation.</param>
        public void Parse(string text, ICoordinateSystem system)
        {
            Debug.Assert(system != null);
            if (system == null)
            {
                throw new ArgumentNullException("system");
            }

            IGeometryBuilder builder = CreateBuilder(system);

            builder.Parse(text, system);
            IGeometry g = (IGeometry)builder.ConstructedGeometry;

            if ((TargetSystem != null) && !system.IsEquivalentTo(TargetSystem))
            {
                g.Populate(this);
            }
            else
            {
                _Geometry = g;
            }
        }
コード例 #3
0
        /// <summary>Parses the geometry defined by the specified WKT representation, in the specified coordinate system.</summary>
        /// <param name="text">The WKT representation of the geometry.</param>
        /// <param name="system">The coordinate system of the WKT representation.</param>
        public void Parse(string text, ICoordinateSystem system)
        {
            Debug.Assert(system != null);
            if (system == null)
            {
                throw new ArgumentNullException("system");
            }

            IGeometryBuilder builder = new GmlGeometryBuilder();

            SimpleFeature.GeometryWktGrammar.Populate(builder, text, system);
            _Geometry g = (_Geometry)builder.ConstructedGeometry;

            if ((TargetSystem != null) && !system.IsEquivalentTo(TargetSystem))
            {
                g.Populate(this);
            }
            else
            {
                _Geometry = g;
            }
        }
コード例 #4
0
        /// <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);
            }
        }
コード例 #5
0
        /// <summary>Parses the geometry defined by the specified WKT representation, in the specified coordinate system.</summary>
        /// <param name="text">The WKT representation of the geometry.</param>
        /// <param name="system">The coordinate system of the WKT representation.</param>
        public void Parse(string text, ICoordinateSystem system)
        {
            Debug.Assert(system!=null);
            if (system==null)
                throw new ArgumentNullException("system");

            IGeometryBuilder builder=CreateBuilder(system);
            builder.Parse(text, system);
            IGeometry g=(IGeometry)builder.ConstructedGeometry;

            if ((TargetSystem!=null) && !system.IsEquivalentTo(TargetSystem))
                g.Populate(this);
            else
                _Geometry=g;
        }
コード例 #6
0
        /// <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);
        }
コード例 #7
0
        /// <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=Factory.CreateGeometryFromWkb(data);

            if ((TargetSystem!=null) && !system.IsEquivalentTo(TargetSystem))
            {
                if (_Geometry!=null)
                {
                    _Geometry.Dispose();
                    _Geometry=null;
                }
                using (var orig=new FdoGeometry(g, system))
                    orig.Populate(this);
            } else
                _Geometry=new FdoGeometry(g, system);
        }
コード例 #8
0
        /// <summary>Parses the geometry defined by the specified WKT representation, in the specified coordinate system.</summary>
        /// <param name="text">The WKT representation of the geometry.</param>
        /// <param name="system">The coordinate system of the WKT representation.</param>
        public void Parse(string text, ICoordinateSystem system)
        {
            Debug.Assert(system!=null);
            if (system==null)
                throw new ArgumentNullException("system");

            IGeometryBuilder builder=new GmlGeometryBuilder();
            SimpleFeature.GeometryWktGrammar.Populate(builder, text, system);
            _Geometry g=(_Geometry)builder.ConstructedGeometry;

            if ((TargetSystem!=null) && !system.IsEquivalentTo(TargetSystem))
                g.Populate(this);
            else
                _Geometry=g;
        }