CoordinateTryParse(String, CartesianType, EagerLoad, Allowed_Parse_Format, Coordinate) Method

Attempts to parse a string into a Coordinate with a specified Cartesian system type and eager loading settings.

Definition

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

Parameters

value  String
Coordinate string
cartesianType  CartesianType
Cartesian Type
eagerLoad  EagerLoad
Eager loading options
formats  Allowed_Parse_Format
Allowed parse formats
coordinate  Coordinate
Coordinate

Return Value

Boolean
boolean

Example

The following example parses an ECEF formatted coordinate string. Because this is an ECEF Cartesian type coordinate, we will specify the Cartesian system type. Parsable format is restricted to Lat/Long and Cartesian/ECEF. Eager loading options have been specified for efficiency.
C#
Coordinate c;
EagerLoad el = new EagerLoad(EagerLoadType.Cartesian);
Allowed_Parse_Format formats = Allowed_Parse_Format.Lat_Long | Allowed_Parse_Format.Cartesian_ECEF;
if(Coordinate.TryParse("5242.097 km, 2444.43 km, 2679.074 km", CartesianType.Cartesian, el, out c))
{
    Console.WriteLine(c); //N 24º 59' 59.987" E 25º 0' 0.001"
}

See Also