Exemplo n.º 1
0
        public void EpsgExample_1_3_3_B_Test()
        {
            var projection = new Mercator(
                new GeographicCoordinate(0.73303829, 0.89011792),
                new Vector2(0, 0),
                new SpheroidEquatorialInvF(6378245, 298.3)
                );
            var input    = new GeographicCoordinate(0.9250245, 0.9250245);
            var expected = new Point2(165704.29, 5171848.07);

            var result = projection.TransformValue(input);

            Assert.AreEqual(expected.X, result.X, 0.03);
            Assert.AreEqual(expected.Y, result.Y, 0.05);
        }
Exemplo n.º 2
0
        public void EpsgExample_1_3_3_B_Test()
        {
            var projection = new Mercator(
                new GeographicCoordinate(0.73303829, 0.89011792),
                new Vector2(0, 0),
                new SpheroidEquatorialInvF(6378245, 298.3)
            );
            var input = new GeographicCoordinate(0.9250245, 0.9250245);
            var expected = new Point2(165704.29, 5171848.07);

            var result = projection.TransformValue(input);

            Assert.AreEqual(expected.X, result.X, 0.03);
            Assert.AreEqual(expected.Y, result.Y, 0.05);
        }
Exemplo n.º 3
0
        public void EpsgExample_1_3_3_A_Test()
        {
            var projection = new Mercator(
                1.91986218,
                0.997,
                new Vector2(3900000, 900000),
                new SpheroidEquatorialInvF(6377397.155, 299.15281)
                );
            var input    = new GeographicCoordinate(-0.05235988, 2.09439510);
            var expected = new Point2(5009726.58, 569150.82);

            var result = projection.TransformValue(input);

            Assert.AreEqual(expected.X, result.X, 0.03);
            Assert.AreEqual(expected.Y, result.Y, 0.02);
        }
Exemplo n.º 4
0
        public void MapProjectionsWorkingManualClarkeLatitudeTableTest()
        {
            var clarke1866 = new SpheroidEquatorialPolar(6378206.4, 6356583.8);
            var projection = new Mercator(0, 1, Vector2.Zero, new SpheroidEquatorialInvF(1.0, clarke1866.InvF)); // it has a major axis of 1.0

            // check all the Y coordinates
            Assert.AreEqual(3.12454, projection.TransformValue(new GeographicCoordinate(1.48352986, 0)).Y, 0.001);   // 85 degrees N
            Assert.AreEqual(1.50031, projection.TransformValue(new GeographicCoordinate(1.13446401, 0)).Y, 0.001);   // 65 degrees N
            Assert.AreEqual(0.87658, projection.TransformValue(new GeographicCoordinate(0.785398163, 0)).Y, 0.001);  // 45 degrees N
            Assert.AreEqual(0.44801, projection.TransformValue(new GeographicCoordinate(0.436332313, 0)).Y, 0.001);  // 25 degrees N
            Assert.AreEqual(0.26309, projection.TransformValue(new GeographicCoordinate(0.261799388, 0)).Y, 0.001);  // 15 degrees N
            Assert.AreEqual(0.08679, projection.TransformValue(new GeographicCoordinate(0.0872664626, 0)).Y, 0.001); // 5 degrees N
            Assert.AreEqual(0, projection.TransformValue(new GeographicCoordinate(0, 0)).Y, 0.001);                  // 0 degrees
        }
Exemplo n.º 5
0
        public void EpsgExample_1_3_3_A_Test()
        {
            var projection = new Mercator(
                1.91986218,
                0.997,
                new Vector2(3900000, 900000),
                new SpheroidEquatorialInvF(6377397.155, 299.15281)
            );
            var input = new GeographicCoordinate(-0.05235988, 2.09439510);
            var expected = new Point2(5009726.58, 569150.82);

            var result = projection.TransformValue(input);

            Assert.AreEqual(expected.X, result.X, 0.03);
            Assert.AreEqual(expected.Y, result.Y, 0.02);
        }
Exemplo n.º 6
0
        public void MapProjectionsWorkingManualClarkeLatitudeTableTest()
        {
            var clarke1866 = new SpheroidEquatorialPolar(6378206.4, 6356583.8);
            var projection = new Mercator(0, 1, Vector2.Zero, new SpheroidEquatorialInvF(1.0, clarke1866.InvF)); // it has a major axis of 1.0

            // check all the Y coordinates
            Assert.AreEqual(3.12454, projection.TransformValue(new GeographicCoordinate(1.48352986, 0)).Y, 0.001); // 85 degrees N
            Assert.AreEqual(1.50031, projection.TransformValue(new GeographicCoordinate(1.13446401, 0)).Y, 0.001); // 65 degrees N
            Assert.AreEqual(0.87658, projection.TransformValue(new GeographicCoordinate(0.785398163, 0)).Y, 0.001); // 45 degrees N
            Assert.AreEqual(0.44801, projection.TransformValue(new GeographicCoordinate(0.436332313, 0)).Y, 0.001); // 25 degrees N
            Assert.AreEqual(0.26309, projection.TransformValue(new GeographicCoordinate(0.261799388, 0)).Y, 0.001); // 15 degrees N
            Assert.AreEqual(0.08679, projection.TransformValue(new GeographicCoordinate(0.0872664626, 0)).Y, 0.001); // 5 degrees N
            Assert.AreEqual(0, projection.TransformValue(new GeographicCoordinate(0, 0)).Y, 0.001); // 0 degrees
        }