Convert Decimal Degrees to Degrees in Minutes Seconds Format

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Beginning
Author:
Anonymous

Version Compatibility: Visual Basic.NET

More information:
If you have the output from, say a geocode service such as Google Maps, and you want to convert the value from decimal degrees to a more readable and useable form, such as degrees minutes seconds, then this function is for you. The function is robust enough to handle negative value input and if you want to use a different symbol set for the degrees minutes seconds, you may do so just by changing the master symbology strings. You can change the number of significant digits that the seconds displays by altering the format string accordingly. ie: for 2 significant digits use {0:##.00}.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: