private void UTM_Parse_Checks(string val) { //Ensures parse success only. Values are compared in normal parser var vals = val.Split('#'); string coordString = vals[0]; UniversalTransverseMercator.Parse(coordString); UniversalTransverseMercator.Parse(coordString, Earth_Ellipsoid_Spec.WGS72_1972); UniversalTransverseMercator.Parse(coordString, 6378137, 298.257222101); }
public void UTM_Ellipsoid_Conversions() { UniversalTransverseMercator utm = UniversalTransverseMercator.Parse("16N 500872 5505009", Earth_Ellipsoid_Spec.Clarke_1866); Coordinate c = UniversalTransverseMercator.ConvertUTMtoLatLong(utm, new EagerLoad(EagerLoadType.UTM_MGRS)); //Check ellipsoid values carry Earth_Ellipsoid ee = Earth_Ellipsoid.Get_Ellipsoid(Earth_Ellipsoid_Spec.Clarke_1866); Assert.AreEqual(ee.Equatorial_Radius, c.Equatorial_Radius, "Equatorial Radius do not match"); Assert.AreEqual(ee.Inverse_Flattening, c.Inverse_Flattening, "Inverse Flattening values do not match"); Assert.AreEqual(utm.LongZone, c.UTM.LongZone, "UTM Long Zones do not match"); Assert.AreEqual(utm.Easting, c.UTM.Easting, 1, "UTM Easting does not match"); Assert.AreEqual(utm.Northing, c.UTM.Northing, 1, "UTM Northing does not match"); c.Set_Datum(Earth_Ellipsoid_Spec.WGS84_1984); Assert.AreEqual(c.UTM.Easting, 500872, 1, "UTM Easting does not match WGS84 expected"); Assert.AreEqual(c.UTM.Northing, 5505228, 1, "UTM Northing does not match WGS84 expected"); }