2025-02-27 18:46:32 +01:00
|
|
|
|
using System;
|
2024-09-11 23:36:21 +02:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// NAD27 UTM Projection with zone number.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class Nad27UtmProjection : TransverseMercatorProjection
|
|
|
|
|
|
{
|
|
|
|
|
|
public const int FirstZone = 1;
|
|
|
|
|
|
public const int LastZone = 22;
|
|
|
|
|
|
public const int FirstZoneEpsgCode = 26700 + FirstZone;
|
|
|
|
|
|
public const int LastZoneEpsgCode = 26700 + LastZone;
|
|
|
|
|
|
|
|
|
|
|
|
public int Zone { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public Nad27UtmProjection(int zone)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (zone < FirstZone || zone > LastZone)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentException($"Invalid NAD27 UTM zone {zone}.", nameof(zone));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Zone = zone;
|
|
|
|
|
|
CrsId = $"EPSG:{26700 + Zone}";
|
|
|
|
|
|
|
|
|
|
|
|
// Clarke 1866
|
|
|
|
|
|
EquatorialRadius = 6378206.4;
|
|
|
|
|
|
Flattening = 1d / 294.978698213898;
|
|
|
|
|
|
ScaleFactor = 0.9996;
|
2025-02-12 19:46:25 +01:00
|
|
|
|
CentralMeridian = zone * 6d - 183d;
|
2024-09-11 23:36:21 +02:00
|
|
|
|
FalseEasting = 5e5;
|
|
|
|
|
|
FalseNorthing = 0d;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|