/// <summary> /// Rounds to resolution of 10 meters. /// </summary> /// <param name="easting">The easting.</param> /// <param name="northing">The northing.</param> /// <returns>returns rounded value.</returns> public static OSGLocation RoundTo10(double easting, double northing) { string eastingStr = "0"; string northingStr = "0"; if (easting != 0.0) { eastingStr = ((int)easting).ToString(); eastingStr = eastingStr.Substring(0, eastingStr.Length - 1) + "0"; } if (northing != 0.0) { northingStr = ((int)northing).ToString(); northingStr = northingStr.Substring(0, northingStr.Length - 1) + "0"; } OSGLocation eastingNorthing = new OSGLocation((eastingStr.Substring(0, eastingStr.Length - 1) + "0").ToInt32(), (northingStr.Substring(0, northingStr.Length - 1) + "0").ToInt32()); return(eastingNorthing); }
/// <summary> /// Rounds to 10. /// </summary> /// <param name="location">The location.</param> /// <returns>returns OSGLocation.</returns> public static OSGLocation RoundTo10(OSGLocation location) { return(Conversion.RoundTo10(location.Easting, location.Northing)); }