Table of Contents

Struct GeoBounds

Namespace
LansMap.Core.Geo

An axis-aligned latitude/longitude box, in degrees WGS84.

public readonly struct GeoBounds
Inherited Members

Remarks

Does not model a span that crosses the antimeridian: a box from longitude 170 to -170 is rejected as min-exceeds-max rather than understood as the 20-degree span across the date line. Callers with global data should split at 180 and work with two boxes.

Constructors

GeoBounds(double, double, double, double)

Creates a bounding box from its edges, in degrees WGS84.

public GeoBounds(double minLat, double minLon, double maxLat, double maxLon)

Parameters

minLat double

Southern edge, degrees WGS84.

minLon double

Western edge, degrees WGS84.

maxLat double

Northern edge, degrees WGS84.

maxLon double

Eastern edge, degrees WGS84.

Exceptions

ArgumentException

Either minimum exceeds its maximum. This is also what an antimeridian-crossing span looks like; see the type remarks.

Properties

Center

The midpoint of the box. This is the center of the rectangle in degrees, not a great-circle or area-weighted centroid.

public LatLon Center { get; }

Property Value

LatLon

MaxLat

Northern edge, degrees WGS84.

public double MaxLat { get; }

Property Value

double

MaxLon

Eastern edge, degrees WGS84.

public double MaxLon { get; }

Property Value

double

MinLat

Southern edge, degrees WGS84.

public double MinLat { get; }

Property Value

double

MinLon

Western edge, degrees WGS84.

public double MinLon { get; }

Property Value

double