public void ProjTransform_Forward()
        {
            Projection src = new Projection("+init=epsg:4326");
            Projection dest = new Projection("+init=epsg:3857");
            ProjTransform tran = new ProjTransform(src, dest);
            double x = -122.33517;
            double y = 47.63752;
            double[] expected = new double[] { -13618288.8305, 6046761.54747 };

            //forward
            double[] actual = tran.Forward(x, y);
            Assert.AreEqual(expected[0], actual[0], .0001);
            Assert.AreEqual(expected[1], actual[1], .0001);
        }
Exemple #2
0
        public void ProjTransform_Forward()
        {
            Projection    src  = new Projection("+init=epsg:4326");
            Projection    dest = new Projection("+init=epsg:3857");
            ProjTransform tran = new ProjTransform(src, dest);
            double        x    = -122.33517;
            double        y    = 47.63752;

            double[] expected = new double[] { -13618288.8305, 6046761.54747 };

            //forward
            double[] actual = tran.Forward(x, y);
            Assert.AreEqual(expected[0], actual[0], .0001);
            Assert.AreEqual(expected[1], actual[1], .0001);
        }
        public void ProjTransform_NoChange()
        {
            Projection src = new Projection("+init=epsg:4326");
            Projection dest = new Projection("+init=epsg:4326");
            ProjTransform tran = new ProjTransform(src, dest);
            double[] expected = new double[] { -122.33517, 47.63752 };

            //forward
            double[] actual = tran.Forward(expected[0], expected[1]);
            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);

            //backward
            actual = tran.Backward(expected[0], expected[1]);
            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
        }
Exemple #4
0
        public void ProjTransform_NoChange()
        {
            Projection    src  = new Projection("+init=epsg:4326");
            Projection    dest = new Projection("+init=epsg:4326");
            ProjTransform tran = new ProjTransform(src, dest);

            double[] expected = new double[] { -122.33517, 47.63752 };

            //forward
            double[] actual = tran.Forward(expected[0], expected[1]);
            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);

            //backward
            actual = tran.Backward(expected[0], expected[1]);
            Assert.AreEqual(expected[0], actual[0]);
            Assert.AreEqual(expected[1], actual[1]);
        }