LatLonRange

Description

struct Tinman.Terrain.Georef.LatLonRange

Derived from

IEquatable<LatLonRange>

The LatLonRange structure represents a geographic range of latitude and longitude angles.

Wrap-around of longitude angles is handled properly, interpreting -180 and +180 as the same value (see LatLon.NormalizeLongitude180). Latitude angles are implicitly clamped to [-90..90] degrees (see LatLon.NormalizeLatitude).

Public / Constants

All


public static readonly attribute All → (LatLonRange)

The geographic range that contains all coordinates.

Undefined


public static readonly attribute Undefined → (LatLonRange)

An undefined range of geographic coordinates.

This value can be used as the initial value for building a geographic range by using Grow1.

Public / Constructors

For

4 overloads


public static method For1 → (1)

latLon in : LatLon

The geographic coordinates.

returns → LatLonRange

The geographic range.

Creates a new instance of LatLonRange which contains the given coordinates.


public static method For2 → (2)

in : LatLon

The first geographic coordinates.

in : LatLon

The second geographic coordinates.

returns → LatLonRange

The geographic range.

Creates a new instance of LatLonRange which contains the given coordinates.


public static method For3 → (2)

latitude in : float64

The latitude angle, in degrees.

longitude in : float64

The longitude angle, in degrees.

returns → LatLonRange

The geographic range.

Creates a new instance of LatLonRange which contains the given coordinates.


public static method For4 → (4)

latitudeA in : float64

The first latitude angle, in degrees.

longitudeA in : float64

The first longitude angle, in degrees.

latitudeB in : float64

The second latitude angle, in degrees.

longitudeB in : float64

The second longitude angle, in degrees.

returns → LatLonRange

The geographic range.

Creates a new instance of LatLonRange which contains the given coordinates.

Public / Methods

Contains

2 overloads


[Pure]
public method Contains1 → (2)

latitude in : float64

The latitude angle, in degrees.

longitude in : float64

The longitude angle, in degrees.

returns → bool

true if the given coordinates are contained in this range,
false if not.

Checks if this range contains the given coordinates.


[Pure]
public method Contains2 → (1)

latLon in : LatLon

The geographic coordinates.

returns → bool

true if the given coordinates are contained in this range,
false if not.

Checks if this range contains the given coordinates.

Flip


[Pure]
public method Flip → ()

returns → LatLonRange

The flipped range.

Flips the longitude range.

The LatLon.Longitude values of Start and End are swapped, which changes Longitude into 360 - Longitude.

Grow

3 overloads


[Pure]
public method Grow1 → (1)

latLon in : LatLon

The geographic coordinates to contain.

returns → LatLonRange

The resulting geographic range.

Grows this geographic range until it contains the given coordinates.

The longitude range grows along the direction that produces the shorter length. Undefined coordinate values will be ignored (see LatLon.IsUndefinedCoordinate).

See also

LatLonRange.Flip


[Pure]
public method Grow2 → (1)

range in : LatLonRange

The geographic coordinate range to contain.

returns → LatLonRange

The resulting geographic range.

Grows this geographic range until it contains the given range.

The longitude range grows along the direction that produces the shorter length.

See also

LatLonRange.Flip


[Pure]
public method Grow3 → (2)

latitude in : float64

The latitude angle, in degrees.

longitude in : float64

The longitude angle, in degrees.

returns → LatLonRange

The resulting geographic range.

Grows this geographic range until it contains the given coordinates.

The longitude range grows along the direction that produces the shorter length. Undefined coordinate values will be ignored (see LatLon.IsUndefinedCoordinate).

See also

LatLonRange.Flip

Public / Attributes

End


public readonly attribute End → (LatLon)

End of the geographic range.

The LatLon value will always be normalized (see LatLon.Normalize). From the end, the longitude range extends westwards towards Start, wrapping at +/- 180 degrees.

Is­Undefined


public attribute IsUndefined → (get)

value : bool

true if the range is undefined, false if not.

Is this geographic range undefined?

Latitude


public attribute Latitude → (get)

value : float64

[0..180]
The latitude range.

Returns the size of the latitude range.

Longitude


public attribute Longitude → (get)

value : float64

[0..360]
The longitude range.

Returns the size of the longitude range.

The size is computed by subtracting Start from End and adding 360 if negative.

Start


public readonly attribute Start → (LatLon)

Start of the geographic range.

The LatLon value will always be normalized (see LatLon.Normalize). From the start, the longitude range extends eastwards towards End, wrapping at +/- 180 degrees.

Serialization

Serializer


public static readonly attribute Serializer → (ITypeSerializer<LatLonRange>)

The serialization helper object for values of LatLonRange.