Пример #1
0
        public void TestParseItBack()
        {
            var p = LocationUtils.FromMercatorToWgs84(new Position(DateTime.Now, 5543147.20, 3718070.99, PositionUnit.Mercator));

            Assertions.AreApproximatelyEqual(44.5, p.Latitude, 0.0000001);
            Assertions.AreApproximatelyEqual(33.4, p.Longitude, 0.0000001);
        }
Пример #2
0
        public void TestParsePositiveOne()
        {
            var p = LocationUtils.ToMercator(new Position(DateTime.Now, 44.5, 33.4));

            Assertions.AreApproximatelyEqual(5543147.20, p.Latitude, 0.005);  // Y
            Assertions.AreApproximatelyEqual(3718070.99, p.Longitude, 0.005); // X
        }
Пример #3
0
        public void ReadMetadataFromLumia()
        {
            var position = ImageUtility.TryExtractPositionFromFile("WP_20141211_001.jpg");

            Assert.IsNotNull(position);
            Assertions.AreApproximatelyEqual(47.6044703, position.Latitude);
            Assertions.AreApproximatelyEqual(-122.1496161, position.Longitude);
            // Unknown dilution of precision.
            Assertions.AreApproximatelyEqual(0, position.DilutionOfPrecision);
        }
Пример #4
0
 public void TestParsePositiveOne()
 {
     Assertions.AreApproximatelyEqual(47.7053278, LatLongParser.ParseString(@"47° 42' 19.18"""));
 }
Пример #5
0
 public void TestParseWithNoFractionalSeconds()
 {
     Assertions.AreApproximatelyEqual(33.600556, LatLongParser.ParseString(@"33° 36' 2"""));
 }
Пример #6
0
 public void TestParseNegativeOne()
 {
     Assertions.AreApproximatelyEqual(-122.204028, LatLongParser.ParseString(@"-122° 12' 14.5"""));
 }
Пример #7
0
 public void TestParseDouble()
 {
     Assertions.AreApproximatelyEqual(3.946, ExifParser.ParseRationalOrDouble("3.946"));
 }