2024-09-10 22:04:44 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2025-01-01 18:57:55 +01:00
|
|
|
|
// Copyright © Clemens Fischer
|
2024-09-10 22:04:44 +02:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// NAD83 UTM Projection with zone number.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class Nad83UtmProjection : TransverseMercatorProjection
|
|
|
|
|
|
{
|
|
|
|
|
|
public const int FirstZone = 1;
|
|
|
|
|
|
public const int LastZone = 23;
|
|
|
|
|
|
public const int FirstZoneEpsgCode = 26900 + FirstZone;
|
|
|
|
|
|
public const int LastZoneEpsgCode = 26900 + LastZone;
|
|
|
|
|
|
|
|
|
|
|
|
public int Zone { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public Nad83UtmProjection(int zone)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (zone < FirstZone || zone > LastZone)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentException($"Invalid NAD83 UTM zone {zone}.", nameof(zone));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Zone = zone;
|
|
|
|
|
|
CrsId = $"EPSG:{26900 + Zone}";
|
|
|
|
|
|
|
|
|
|
|
|
// GRS 1980
|
|
|
|
|
|
EquatorialRadius = 6378137d;
|
|
|
|
|
|
Flattening = 1d / 298.257222101;
|
|
|
|
|
|
ScaleFactor = 0.9996;
|
2025-02-12 19:46:25 +01:00
|
|
|
|
CentralMeridian = zone * 6d - 183d;
|
2024-09-10 22:04:44 +02:00
|
|
|
|
FalseEasting = 5e5;
|
|
|
|
|
|
FalseNorthing = 0d;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|