public String ToMgrsString(Int16 digits) { String result = String.Empty; Int16 actualDigits = MakeDigitValid(digits); String northing = Northing.ToString("0000000"); String easting = Easting.ToString("0000000"); String eastingLetters = MgrsEastingChars(ZoneNumber); Int32 eastingIdentifier = Convert.ToInt32(easting.Substring(0, 2)) % 8; if (eastingIdentifier != 0) { String eastingChar = eastingLetters.Substring(eastingIdentifier - 1, 1); Int32 northingIdentifier = Convert.ToInt32(northing.Substring(0, 1)); northingIdentifier = (northingIdentifier % 2) * 10; northingIdentifier = northingIdentifier + Convert.ToInt32(northing.Substring(1, 1)); String northingLetters = MgrsNorthingChars(ZoneNumber); String northingChar = northingLetters.Substring(northingIdentifier, 1); result = ZoneNumber.ToString("00") + ZoneBand() + ' ' + eastingChar + northingChar + ' ' + easting.Substring(2, actualDigits - 2) + northing.Substring(2, actualDigits - 2); } return(result); }
/// <summary> /// Returns a <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>. /// </summary> /// <returns> /// A <see cref="T:System.String"></see> that represents the current <see cref="T:System.Object"></see>. /// </returns> public override string ToString() { string seperator = ","; return (string.Concat(line1, seperator, line2, seperator, line3, seperator, line4, seperator, line5, seperator, postCode, seperator, DPS, seperator, Northing.ToString(), Easting.ToString())); }
public override string ToString() { if (_canonicalOsRef) { return(Easting.ToString() + "m, " + Northing.ToString() + "m"); } else { return(Latitude.ToString() + ", " + Longitude.ToString()); } }
public String ToUtmString(Int16 digits) { Int16 actualDigits = MakeDigitValid(digits); String northing = Northing.ToString("0000000"); String easting = Easting.ToString("0000000"); easting = easting.Substring(0, actualDigits); northing = northing.Substring(0, actualDigits); String result = ZoneNumber.ToString("00") + ZoneBand() + ' ' + easting + ' ' + northing; return(result); }
public override string ToString() { return(ZoneIdentifier.ToString(System.Globalization.CultureInfo.InvariantCulture) + Easting.ToString(System.Globalization.CultureInfo.InvariantCulture) + "E, " + Northing.ToString(System.Globalization.CultureInfo.InvariantCulture) + "N"); }
public override string ToString() { return(Easting.ToString("#.#") + ", " + Northing.ToString("#.#")); }