Esempio n. 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((Easting.GetHashCode() * 397) ^ Northing.GetHashCode());
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        /// <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()));
        }
Esempio n. 4
0
 /// <summary>
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Easting.GetHashCode();
         hashCode = (hashCode * 397) ^ Northing.GetHashCode();
         hashCode = (hashCode * 397) ^ LatZone.GetHashCode();
         hashCode = (hashCode * 397) ^ LngZone;
         return(hashCode);
     }
 }
Esempio n. 5
0
 public override string ToString()
 {
     if (_canonicalOsRef)
     {
         return(Easting.ToString() + "m, " + Northing.ToString() + "m");
     }
     else
     {
         return(Latitude.ToString() + ", " + Longitude.ToString());
     }
 }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 private bool Equals(UtmRef other)
 {
     return(Easting.Equals(other.Easting) && Northing.Equals(other.Northing) && LatZone == other.LatZone &&
            LngZone == other.LngZone);
 }
Esempio n. 8
0
 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");
 }
Esempio n. 9
0
 public override string ToString()
 {
     return(Easting.ToString("#.#") + ", " + Northing.ToString("#.#"));
 }