internal GeoTestDataSet(string city, PolarGeoCoordinate oSGB36, PolarGeoCoordinate wGS84, GridReference nE) { this.City = city; this.OSGB36 = oSGB36; this.WGS84 = wGS84; this.NE = nE; }
public void TestGridrefToPolarGeo() { StringBuilder sb = new StringBuilder(); foreach (GeoTestDataSet item in testData) { PolarGeoCoordinate converted = GridReference.ChangeToPolarGeo(item.NE); if (!item.OSGB36.IsTheSameAs(converted, true, true)) { sb.AppendLine(item.City); } } if (sb.Length > 0) { sb.AppendLine("failed out of" + testData.Count.ToString()); Assert.Fail(sb.ToString()); } }
public void TestOSGB36ToWGS84() { StringBuilder sb = new StringBuilder(); foreach (GeoTestDataSet item in testData) { PolarGeoCoordinate converted = PolarGeoCoordinate.ChangeCoordinateSystem(item.OSGB36, CoordinateSystems.WGS84); if (!item.WGS84.IsTheSameAs(converted, true, true)) { sb.AppendLine(item.City); } } if (sb.Length > 0) { sb.AppendLine("failed out of" + testData.Count.ToString()); Assert.Fail(sb.ToString()); } }
public void TestWGS84PolarGeoToGridref() { var sb = new StringBuilder(); foreach (GeoTestDataSet item in TestData) { GridReference converted = PolarGeoCoordinate.ChangeToGridReference(item.WGS84); if (!item.NE.IsTheSameAs(converted, true)) { sb.AppendLine(item.City); } } if (sb.Length > 0) { sb.AppendLine("failed out of" + TestData.Count.ToString(CultureInfo.InvariantCulture)); Assert.Fail(sb.ToString()); } }
public void TestWGS84ToOSGB36TestOSGB36ToWGS84() { var sb = new StringBuilder(); foreach (GeoTestDataSet item in TestData) { PolarGeoCoordinate converted = PolarGeoCoordinate.ChangeCoordinateSystem( item.WGS84, CoordinateSystems.OSGB36); if (!item.OSGB36.IsTheSameAs(converted, true, true)) { sb.AppendLine(item.City); } } if (sb.Length > 0) { sb.AppendLine("failed out of" + TestData.Count.ToString(CultureInfo.InvariantCulture)); Assert.Fail(sb.ToString()); } }
public void TestRadiansToDegrees() { var deg = new PolarGeoCoordinate(180, 180, 0, AngleUnit.Degrees, CoordinateSystems.OSGB36); var rad = new PolarGeoCoordinate(Math.PI, Math.PI, 0, AngleUnit.Radians, CoordinateSystems.OSGB36); Assert.IsTrue(deg.IsTheSameAs(PolarGeoCoordinate.ChangeUnits(rad, AngleUnit.Degrees))); }
public void TestDegreesToRadians() { PolarGeoCoordinate deg = new PolarGeoCoordinate(180, 180, 0, AngleUnit.Degrees, CoordinateSystems.OSGB36); PolarGeoCoordinate rad = new PolarGeoCoordinate(Math.PI, Math.PI, 0, AngleUnit.Radians, CoordinateSystems.OSGB36); Assert.IsTrue(rad.IsTheSameAs(PolarGeoCoordinate.ChangeUnits(deg, AngleUnit.Radians))); }