Exemplo n.º 1
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");
            }

            _Builder = new Gml.GmlGeometryBuilder(system);
            _Builder.Parse(text, system);
        }
Exemplo n.º 2
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());
        }
Exemplo n.º 3
0
        /// <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);
        }
Exemplo n.º 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());
        }
Exemplo n.º 5
0
        /// <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);
        }
Exemplo n.º 6
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");

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