Moved EquatorialRadius property to MapProjection

This commit is contained in:
ClemensFischer 2026-01-24 14:58:16 +01:00
parent aaa69a3c03
commit d71d6c6e01
14 changed files with 53 additions and 70 deletions

View file

@ -31,11 +31,6 @@ namespace MapControl
public const double Wgs84Flattening = 1d / 298.257223563;
public const double Wgs84MeterPerDegree = Wgs84EquatorialRadius * Math.PI / 180d;
// Arithmetic mean radius (2*a + b) / 3 == (1 - f/3) * a.
// See https://en.wikipedia.org/wiki/Earth_radius#Arithmetic_mean_radius.
//
public const double Wgs84MeanRadius = (1d - Wgs84Flattening / 3d) * Wgs84EquatorialRadius;
public static MapProjectionFactory Factory
{
get => field ??= new MapProjectionFactory();
@ -60,6 +55,13 @@ namespace MapControl
/// </summary>
public string CrsId { get; protected set; } = "";
/// <summary>
/// The earth ellipsoid semi-major axis, or spherical earth radius, in meters.
/// </summary>
public double EquatorialRadius { get; set; } = Wgs84EquatorialRadius;
public double MeterPerDegree => EquatorialRadius * Math.PI / 180d;
private Location center;
private bool updateCenter = hasCenter;