CoordinateTryParse(String, EagerLoad, Allowed_Parse_Format, Coordinate) Method

Attempts to parse a string into a Coordinate with specified eager loading settings.

Definition

Namespace: CoordinateSharp
Assembly: CoordinateSharp (in CoordinateSharp.dll) Version: 2.21.1.1
XMLNS for XAML: Not mapped to an xmlns.
C#
public static bool TryParse(
	string value,
	EagerLoad eagerLoad,
	Allowed_Parse_Format formats,
	out Coordinate coordinate
)

Parameters

value  String
Coordinate string
eagerLoad  EagerLoad
Eager loading options
formats  Allowed_Parse_Format
Allowed parse formats
coordinate  Coordinate
Coordinate

Return Value

Boolean
boolean

Example

The following example parses a decimal degree formatted geodetic coordinate string. Parsable format is restricted to Lat/Long and Cartesian/ECEF. Eager loading is turned off for improved efficiency.
C#
Coordinate c;
EagerLoad el = new EagerLoad(false);
Allowed_Parse_Format formats = Allowed_Parse_Format.Lat_Long | Allowed_Parse_Format.Cartesian_ECEF;
if(Coordinate.TryParse("N 32.891º W 64.872º", el, out c))
{
    Console.WriteLine(c); //N 32º 53' 28.212" W 64º 52' 20.914"
}

See Also