Example #1
0
        public void DgRoundTripWgs84Numeric()
        {
            var DgGridRef = OsGridRef.Parse("TQ 44359 80653");
            var DgWgs     = DgGridRef.ToLatLon(Datum.WGS84);

            Assert.AreEqual("544358.997,180653", DgWgs.ToGridRef().ToString(0));
        }
Example #2
0
        public void C2()
        {
            var GridRef = new OsGridRef(651409.903, 313177.270);
            var Osgb    = GridRef.ToLatLon(Datum.OSGB36);

            Assert.AreEqual("52°" + DMS.Separator + "39′" + DMS.Separator + "27.2531″N, 001°" + DMS.Separator + "43′" + DMS.Separator + "04.5177″E", Osgb.ToString("dms", 4));
        }
Example #3
0
        public void DgRoundTripOsgb36Numeric()
        {
            OsGridRef         DgGridRef = OsGridRef.Parse("TQ 44359 80653");
            LatLonEllipsoidal DgOsgb    = DgGridRef.ToLatLon(Datum.OSGB36);

            Assert.AreEqual("544359,180653", DgOsgb.ToGridRef().ToString(0));
        }
Example #4
0
        public void C2NRoundTrip()
        {
            var GridRef  = new OsGridRef(651409.903, 313177.270);
            var Osgb     = GridRef.ToLatLon(Datum.OSGB36);
            var GridRef2 = Osgb.ToGridRef();

            Assert.AreEqual(313177.270, GridRef2.Northing);
        }
Example #5
0
 public void ParseNumeric()
 {
     Assert.AreEqual("SU 38700 14800", OsGridRef.Parse("438700,114800").ToString());
 }
Example #6
0
 public void Parse10Digit()
 {
     Assert.AreEqual("SU 38700 14800", OsGridRef.Parse("SU 38700 14800").ToString());
 }
Example #7
0
 public void ParseNoWhitespace()
 {
     Assert.AreEqual("SU 38700 14800", OsGridRef.Parse("SU387148").ToString());
 }
Example #8
0
 public void Parse100kmOrigin2()
 {
     Assert.AreEqual("SU 00000 00000", OsGridRef.Parse("SU 0 0").ToString());
 }