/// <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");
            }

            _Builder = new Gml.GmlGeometryBuilder(system);
            _Builder.Parse(text, system);
        }
        public void ShouldReverseGeometries(string input, string expected)
        {
            var obuilder=new Ogc.Gml.V311.GmlGeometryBuilder();
            obuilder.Parse(input, CommonServiceLocator.GetCoordinateSystemProvider().Wgs84);

            var builder=new Ogc.Gml.V311.GmlGeometryBuilder();
            var rsink=new ReversedGeometrySink(builder);
            obuilder.ConstructedGeometry.Populate(rsink);

            var g=builder.ConstructedGeometry;

            Assert.Equal<string>(expected, g.ToString());
        }
        /// <summary>Parses 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>
        void IGeometryBuilder.Parse(byte[] data, ICoordinateSystem system)
        {
            Debug.Assert(system != null);
            if (system == null)
            {
                throw new ArgumentNullException("system");
            }

            var g = DbGeometry.FromBinary(data);

            _Builder = new Gml.GmlGeometryBuilder(system);
            _Builder.Parse(g.AsText(), system);
        }
Beispiel #4
0
        public void ShouldReverseGeometries(string input, string expected)
        {
            var obuilder = new Ogc.Gml.V311.GmlGeometryBuilder();

            obuilder.Parse(input, CommonServiceLocator.GetCoordinateSystemProvider().Wgs84);

            var builder = new Ogc.Gml.V311.GmlGeometryBuilder();
            var rsink   = new ReversedGeometrySink(builder);

            obuilder.ConstructedGeometry.Populate(rsink);

            var g = builder.ConstructedGeometry;

            Assert.Equal <string>(expected, g.ToString());
        }
        /// <summary>Parses 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>
        void IGeometryBuilder.Parse(byte[] data, ICoordinateSystem system)
        {
            Debug.Assert(system!=null);
            if (system==null)
                throw new ArgumentNullException("system");

            var g=DbGeometry.FromBinary(data);
            _Builder=new Gml.GmlGeometryBuilder(system);
            _Builder.Parse(g.AsText(), system);
        }
        /// <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");

            _Builder=new Gml.GmlGeometryBuilder(system);
            _Builder.Parse(text, system);
        }