var webMercator = new WebMercator(); var result = webMercator.ToGeographic(mapPoint) as MapPoint;
protected string ConvertToDMS(double decimalDegrees) { string dms = string.Empty; // Get degrees double dd = Math.Abs(decimalDegrees); double degrees = Math.Floor(dd); // Get minutes dd = dd - Math.Floor(dd); dd *= 60; double minutes = Math.Floor(dd); // Seconds. // Math to eliminate eensy and teensy fractions of seconds. double seconds = 60 * (dd - Math.Floor(dd)); seconds *= 1000; seconds = Math.Round(seconds); seconds /= 1000; if (seconds >= 60) { seconds -= 60; minutes++; } if (minutes >= 60) { minutes -= 60; degrees++; } string degreesText = Math.Floor(degrees).ToString(); string minutesText = Math.Floor(minutes).ToString(); string formattedSeconds = seconds.ToString("N2"); char chr = (char)176; string degreeSymbol = chr.ToString(); dms = degreesText + degreeSymbol + " " + minutesText + "'" + " " + formattedSeconds + "\""; return dms; }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.