Maria GDK 4.5.0.137
Documentation of managed code in release branch
Loading...
Searching...
No Matches
TPG.GeoUnits.GeoPos Struct Reference

Represents a geographical position. More...

Public Member Functions

 GeoPos (double lat, double lon)
 Initializes a new instance of the GeoPos struct from separate latitude and longitude values (degrees).
 
 GeoPos (double latDeg, double latMin, double latSec, double lonDeg, double lonMin, double lonSec)
 Initializes a new instance of the GeoPos struct from dms components.
 
 GeoPos (Tuple< double, double > latlon)
 Initializes a new instance of the GeoPos struct from a latitude and longitude pair (degrees).
 
void Set (double lat, double lon)
 Sets/re-sets the position.
 
void SetInvalid ()
 Sets the content to an invalid position.
 
override bool Equals (object obj)
 Checks if a GeoPos structs have equal content to this.
 
override int GetHashCode ()
 Get the objects hash code.
 
override string ToString ()
 Returns the GeoPos struct as formatted string (PositionFormat: GeoDMS).
 
string ToString (PositionFormat posFormat)
 Returns the GeoPos struct as formatted string, selectable format.
 
string ToString (string formatString, CultureInfo ci=null)
 Returns the GeoPos struct as formatted string (PositionFormat: GeoDMS).
 
void Normalize (double eps=0.0)
 Normalize position by clamping latitude to [-90, 90] and keeping longitude between -180 and 180 by modulo.
 

Static Public Member Functions

static bool operator== (GeoPos p1, GeoPos p2)
 Checks if two GeoPos structs have equal content.
 
static bool operator!= (GeoPos p1, GeoPos p2)
 Checks if two GeoPos structs have different content.
 
static GeoPos Parse (string s, IGeoUnitsSettingProvider unitSettingProvider)
 Parsing the content of a formatted position string according to provided format.
 
static GeoPos Parse (string s, PositionFormat posFormat)
 Parsing the content of a formatted position string according to provided format.
 
static bool TryParse (string s, IGeoUnitsSettingProvider unitSettingProvider, out GeoPos gp)
 Try parsing the content of a formatted position string according to provided format.
 
static bool TryParse (string s, PositionFormat posFormat, out GeoPos gp)
 Try parsing the content of a formatted position string according to provided format.
 

Public Attributes

double Lat
 Latitude of the position, in degrees.
 
double Lon
 Longitude of the position, in degrees.
 

Properties

bool IsValid [get]
 Valitation of position.
 
static GeoPos InvalidPos [get]
 GeoPos struct representing an invalid position.
 

Detailed Description

Represents a geographical position.

Constructor & Destructor Documentation

◆ GeoPos() [1/3]

TPG.GeoUnits.GeoPos.GeoPos ( double  lat,
double  lon 
)
inline

Initializes a new instance of the GeoPos struct from separate latitude and longitude values (degrees).

Parameters
latLatitude of the position, in degrees.
lonLongitude of the position, in degrees.

◆ GeoPos() [2/3]

TPG.GeoUnits.GeoPos.GeoPos ( double  latDeg,
double  latMin,
double  latSec,
double  lonDeg,
double  lonMin,
double  lonSec 
)
inline

Initializes a new instance of the GeoPos struct from dms components.

Parameters
latDegLatitude degrees [-90,90]
latMinLatutude minutes
latSecLatitude seconds
lonDegLongitude degrees [-180,180]
lonMinLongitude minutes
lonSecLongitude seconds

◆ GeoPos() [3/3]

TPG.GeoUnits.GeoPos.GeoPos ( Tuple< double, double >  latlon)
inline

Initializes a new instance of the GeoPos struct from a latitude and longitude pair (degrees).

Parameters
latlonPair of latitude & longitude

Member Function Documentation

◆ Equals()

override bool TPG.GeoUnits.GeoPos.Equals ( object  obj)
inline

Checks if a GeoPos structs have equal content to this.

Parameters
obj
Returns

◆ GetHashCode()

override int TPG.GeoUnits.GeoPos.GetHashCode ( )
inline

Get the objects hash code.

Returns
Hash code.

◆ Normalize()

void TPG.GeoUnits.GeoPos.Normalize ( double  eps = 0::0)
inline

Normalize position by clamping latitude to [-90, 90] and keeping longitude between -180 and 180 by modulo.

Parameters
eps

◆ operator!=()

static bool TPG.GeoUnits.GeoPos.operator!= ( GeoPos  p1,
GeoPos  p2 
)
inlinestatic

Checks if two GeoPos structs have different content.

Parameters
p1
p2
Returns

◆ operator==()

static bool TPG.GeoUnits.GeoPos.operator== ( GeoPos  p1,
GeoPos  p2 
)
inlinestatic

Checks if two GeoPos structs have equal content.

Parameters
p1First GeoPos
p2Second GeoPos
Returns

◆ Parse() [1/2]

static GeoPos TPG.GeoUnits.GeoPos.Parse ( string  s,
IGeoUnitsSettingProvider  unitSettingProvider 
)
inlinestatic

Parsing the content of a formatted position string according to provided format.

Parameters
sString to be parsed.
unitSettingProviderProvided IGeoUnitsSettingProvider format.
Returns
New GeoPos instance.

◆ Parse() [2/2]

static GeoPos TPG.GeoUnits.GeoPos.Parse ( string  s,
PositionFormat  posFormat 
)
inlinestatic

Parsing the content of a formatted position string according to provided format.

Parameters
sString to be parsed.
posFormatProvided PositionFormat format.
Returns
New GeoPos instance.

◆ Set()

void TPG.GeoUnits.GeoPos.Set ( double  lat,
double  lon 
)
inline

Sets/re-sets the position.

Parameters
latLatitude of the position, in degrees.
lonLongitude of the position, in degrees.

◆ ToString() [1/3]

override string TPG.GeoUnits.GeoPos.ToString ( )
inline

Returns the GeoPos struct as formatted string (PositionFormat: GeoDMS).

Returns
Formatted string.

◆ ToString() [2/3]

string TPG.GeoUnits.GeoPos.ToString ( PositionFormat  posFormat)
inline

Returns the GeoPos struct as formatted string, selectable format.

Parameters
posFormatSelected PositionFormat.
Returns
Formatted string.

◆ ToString() [3/3]

string TPG.GeoUnits.GeoPos.ToString ( string  formatString,
CultureInfo  ci = null 
)
inline

Returns the GeoPos struct as formatted string (PositionFormat: GeoDMS).

Returns
Formatted string.

◆ TryParse() [1/2]

static bool TPG.GeoUnits.GeoPos.TryParse ( string  s,
IGeoUnitsSettingProvider  unitSettingProvider,
out GeoPos  gp 
)
inlinestatic

Try parsing the content of a formatted position string according to provided format.

Parameters
sString to be parsed.
unitSettingProviderProvided IGeoUnitsSettingProvider format.
gpNew GeoPos instance.
Returns
True if parsed sucessfully, othervice false.

◆ TryParse() [2/2]

static bool TPG.GeoUnits.GeoPos.TryParse ( string  s,
PositionFormat  posFormat,
out GeoPos  gp 
)
inlinestatic

Try parsing the content of a formatted position string according to provided format.

Parameters
sString to be parsed.
posFormatProvided PositionFormat format.
gpNew GeoPos instance.
Returns
True if parsed sucessfully, othervice false.

Member Data Documentation

◆ Lat

double TPG.GeoUnits.GeoPos.Lat

Latitude of the position, in degrees.

Between -90.0 and 90.0 defgrees.

◆ Lon

double TPG.GeoUnits.GeoPos.Lon

Longitude of the position, in degrees.

Between -180.0 and 180.0 degrees.

Property Documentation

◆ IsValid

bool TPG.GeoUnits.GeoPos.IsValid
get

Valitation of position.

True if contained position is valid, otherwice false.


The documentation for this struct was generated from the following file: