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

Robust lat-lon rectangle representation. More...

Public Member Functions

GeoRect Clone ()
 Create a clone of the object. Strictly not required for structs, but removes caller assumptions that GeoPos is a struct.
 
 GeoRect (double swLat, double swLon, double neLat, double neLon)
 Initializes a new instance of the GeoRect struct from south, west, north and east most points.
 
 GeoRect (GeoPos sw, GeoPos ne)
 Initializes a new instance of the GeoRect struct from south-west most and north-east most points.
 
 GeoRect (GeoPos pos)
 Initializes a new instance of the GeoRect struct, from another GeoRect struct.
 
 GeoRect (GeoPos pos, double deltaLat, double deltaLon)
 Initializes a new instance of the GeoRect struct from centerposition, height and width.
 
 GeoRect (double minLat, double maxLat)
 Initializes a new instance of the GeoRect struct, form min/max latitude, with longitude -180 - 180.
 
 GeoRect (GeoPos[] pos)
 Initializes a new instance of the GeoRect struct containing the minimum enclosing rectangle which bounds the given GeoRect structs. Please note that if the input points span a longitude range of more than 180 degrees, the minimum bounding rectangle may be on the opposite side of the globe and less than 180 degrees in longitude!
 
void AddPos (GeoPos pos)
 Extend the area by including a new position.
 
override string ToString ()
 Return center position and delta lat/long formatted.
 
bool Contains (GeoPos pos)
 Checks if a given GeoPos is inside the area.
 
bool Intersects (GeoRect rc)
 Checks if a given GeoRect intersects the area.
 
bool Contains (GeoRect rc)
 Checks if a given GeoRect is contained in the area.
 
GeoRect Intersection (GeoRect rc)
 Returns the intersecting area of two GeoRect structs.
 
override bool Equals (object obj)
 Chacks if two GeoRect structs are equal.
 
void InflateRelative (double factor)
 Inflate latitude and longitude extents with given factor.
 
void InflateAbsolute (double deltaLat, double deltaLon)
 Inflate latitude and longitude.
 
override int GetHashCode ()
 Not implemented!
 

Static Public Member Functions

static double NormalizedLat (double lat)
 Normalizing a latitude value.
 
static double NormalizedLon (double lon)
 Normalizing a longitude value.
 
static double LatDistance (double lat1, double lat2)
 Calculates delta latitude.
 
static double LonDistance (double lon1, double lon2)
 Calculates delta longitude.
 

Public Attributes

GeoPos Center
 The center position.
 
double DeltaLat
 Delta latitude ("lattitude size").
 
double DeltaLon
 Delta longitude ("longitude size")
 

Static Public Attributes

static readonly GeoRect Global = new GeoRect(new GeoPos(0, 0), 180.0, 360.0)
 GeoRect struct representing the entire globe. (Center point 0,0 - 180 degrees heigh (delta lat) 360 degrees wide (delta longitude).
 

Properties

bool IsInit [get]
 True if rectangle has an area - or centerpoint differs from 0,0. Otherwice false.
 
bool HasArea [get]
 True if rectangle has an area. Otherwice false.
 
bool IsValid [get]
 True centerpoint ia a valid position.Otherwice false.
 
GeoPos LowerLeft [get]
 Get LowerLeft position of GeoRect struct.
 
GeoPos UpperRight [get]
 Get UpperRight position of GeoRect struct.
 
GeoPos UpperLeft [get]
 Get UpperLeft position of GeoRect struct.
 
GeoPos LowerRight [get]
 Get LowerRight position of GeoRect struct.
 

Detailed Description

Robust lat-lon rectangle representation.

Constructor & Destructor Documentation

◆ GeoRect() [1/6]

TPG.GeoUnits.GeoRect.GeoRect ( double  swLat,
double  swLon,
double  neLat,
double  neLon 
)
inline

Initializes a new instance of the GeoRect struct from south, west, north and east most points.

Parameters
swLatSouth most point (latitude).
swLonWest most point (longitude).
neLatNorth most point (latitude).
neLonEast most point (longitude).

◆ GeoRect() [2/6]

TPG.GeoUnits.GeoRect.GeoRect ( GeoPos  sw,
GeoPos  ne 
)
inline

Initializes a new instance of the GeoRect struct from south-west most and north-east most points.

Parameters
swSouth-west most point.
nenorth-east most point.

◆ GeoRect() [3/6]

TPG.GeoUnits.GeoRect.GeoRect ( GeoPos  pos)
inline

Initializes a new instance of the GeoRect struct, from another GeoRect struct.

Parameters
posCenter position.

◆ GeoRect() [4/6]

TPG.GeoUnits.GeoRect.GeoRect ( GeoPos  pos,
double  deltaLat,
double  deltaLon 
)
inline

Initializes a new instance of the GeoRect struct from centerposition, height and width.

Parameters
posCenter position.
deltaLatDelta latitude ("lattitude size").
deltaLonDelta Longitude ("longitudel size").

◆ GeoRect() [5/6]

TPG.GeoUnits.GeoRect.GeoRect ( double  minLat,
double  maxLat 
)
inline

Initializes a new instance of the GeoRect struct, form min/max latitude, with longitude -180 - 180.

Parameters
minLatSouth most edge.
maxLatNorth most edge.

special case includes poles, either minLat must be -90 or maxLat must be 90

◆ GeoRect() [6/6]

TPG.GeoUnits.GeoRect.GeoRect ( GeoPos[]  pos)
inline

Initializes a new instance of the GeoRect struct containing the minimum enclosing rectangle which bounds the given GeoRect structs. Please note that if the input points span a longitude range of more than 180 degrees, the minimum bounding rectangle may be on the opposite side of the globe and less than 180 degrees in longitude!

Parameters
pos

Member Function Documentation

◆ AddPos()

void TPG.GeoUnits.GeoRect.AddPos ( GeoPos  pos)
inline

Extend the area by including a new position.

Parameters
posNew position.

◆ Clone()

GeoRect TPG.GeoUnits.GeoRect.Clone ( )
inline

Create a clone of the object. Strictly not required for structs, but removes caller assumptions that GeoPos is a struct.

Returns

◆ Contains() [1/2]

bool TPG.GeoUnits.GeoRect.Contains ( GeoPos  pos)
inline

Checks if a given GeoPos is inside the area.

Parameters
posPosition to check.
Returns
True if area contains the given position, otherwice false.

◆ Contains() [2/2]

bool TPG.GeoUnits.GeoRect.Contains ( GeoRect  rc)
inline

Checks if a given GeoRect is contained in the area.

Parameters
rcRectangle to check.
Returns
True if rc is fully contained in the area

◆ Equals()

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

Chacks if two GeoRect structs are equal.

Parameters
objStruct to check.
Returns
True if equal, otherwice false.

◆ GetHashCode()

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

Not implemented!

Returns
Not implemented!

◆ InflateAbsolute()

void TPG.GeoUnits.GeoRect.InflateAbsolute ( double  deltaLat,
double  deltaLon 
)
inline

Inflate latitude and longitude.

Parameters
deltaLatDegrees added to latitude
deltaLonDegrees added to longitude

◆ InflateRelative()

void TPG.GeoUnits.GeoRect.InflateRelative ( double  factor)
inline

Inflate latitude and longitude extents with given factor.

Parameters
factorMultiply latitude extents and longitude extents with this factor

◆ Intersection()

GeoRect TPG.GeoUnits.GeoRect.Intersection ( GeoRect  rc)
inline

Returns the intersecting area of two GeoRect structs.

Parameters
rcIntersecting struct.
Returns
The intersecting area.

◆ Intersects()

bool TPG.GeoUnits.GeoRect.Intersects ( GeoRect  rc)
inline

Checks if a given GeoRect intersects the area.

Parameters
rcRectangle to check.
Returns
True if any part of rc is inside the area

◆ LatDistance()

static double TPG.GeoUnits.GeoRect.LatDistance ( double  lat1,
double  lat2 
)
inlinestatic

Calculates delta latitude.

Parameters
lat1First latitude.
lat2Second latitude.
Returns
Delta latitude

◆ LonDistance()

static double TPG.GeoUnits.GeoRect.LonDistance ( double  lon1,
double  lon2 
)
inlinestatic

Calculates delta longitude.

Parameters
lon1First longitude.
lon2Second longitude.
Returns
Delta longitude

◆ NormalizedLat()

static double TPG.GeoUnits.GeoRect.NormalizedLat ( double  lat)
inlinestatic

Normalizing a latitude value.

Parameters
lat"Raw" latitude value.
Returns
Normalized latitude, between -90 and 90 (truncated)

◆ NormalizedLon()

static double TPG.GeoUnits.GeoRect.NormalizedLon ( double  lon)
inlinestatic

Normalizing a longitude value.

Parameters
lon"Raw" longitude value.
Returns
Normalized longitude, between -180 and 180 (adjusted)

◆ ToString()

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

Return center position and delta lat/long formatted.

Returns
Formatted result.

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