Click here to Skip to main content
12,248,339 members (46,652 online)
Click here to Skip to main content


73 bookmarked

Parsing Latitude and Longitude Information

, 21 Feb 2012 CPOL
Parses user input and extracts latitude and longitude information, taking into account the user's language and regional settings
using System;

namespace Geospatial
    /// <summary>
    /// Determines the styles permitted in string arguments that are passed
    /// to the Parse/TryParse methods of Location.
    /// </summary>
    public enum LocationStyles
        /// <summary>
        /// Default formatting optiona are used. Indicates that the Degrees,
        /// DegreesMinutes and DegreeMinuteSeconds styles are used.
        /// </summary>
        None = 0x00,

        /// <summary>Allows parsing of degree values only.</summary>
        Degrees = 0x01,

        /// <summary>
        /// Allows parsing of values that contain both degrees and minutes.
        /// </summary>
        DegreesMinutes = 0x02,

        /// <summary>
        /// Allows parsing of values that contain degrees, minutes and seconds.
        /// </summary>
        DegreesMinutesSeconds = 0x04,

        /// <summary>
        /// Allows parsing of values formmated to ISO 6709.
        /// </summary>
        Iso = 0x08,

        /// <summary>
        /// Indicates that the Degrees, DegreesMinutes, DegreeMinuteSeconds
        /// and Iso styles are used.
        /// </summary>
        Any = Degrees | DegreesMinutes | DegreesMinutesSeconds | Iso

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Samuel Cragg
United Kingdom United Kingdom
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160426.1 | Last Updated 21 Feb 2012
Article Copyright 2011 by Samuel Cragg
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid