2022-12-14 18:02:19 +01:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2025-01-01 18:57:55 +01:00
|
|
|
|
// Copyright © Clemens Fischer
|
2022-12-14 18:02:19 +01:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl.Projections
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// NAD83 UTM Projection with zone number.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class Nad83UtmProjection : GeoApiProjection
|
|
|
|
|
|
{
|
|
|
|
|
|
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;
|
|
|
|
|
|
CoordinateSystemWkt
|
|
|
|
|
|
= $"PROJCS[\"NAD83 / UTM zone {zone}N\","
|
|
|
|
|
|
+ "GEOGCS[\"NAD83\","
|
|
|
|
|
|
+ "DATUM[\"North_American_Datum_1983\","
|
2024-09-12 12:22:33 +02:00
|
|
|
|
+ "SPHEROID[\"GRS 1980\",6378137,298.257222101]],"
|
2022-12-14 18:02:19 +01:00
|
|
|
|
+ "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
|
|
|
|
|
|
+ "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],"
|
|
|
|
|
|
+ "AUTHORITY[\"EPSG\",\"4269\"]],"
|
|
|
|
|
|
+ "PROJECTION[\"Transverse_Mercator\"],"
|
|
|
|
|
|
+ "PARAMETER[\"latitude_of_origin\",0],"
|
|
|
|
|
|
+ $"PARAMETER[\"central_meridian\",{6 * zone - 183}],"
|
|
|
|
|
|
+ "PARAMETER[\"scale_factor\",0.9996],"
|
|
|
|
|
|
+ "PARAMETER[\"false_easting\",500000],"
|
|
|
|
|
|
+ "PARAMETER[\"false_northing\",0],"
|
|
|
|
|
|
+ "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
|
|
|
|
|
|
+ "AXIS[\"Easting\",EAST],"
|
|
|
|
|
|
+ "AXIS[\"Northing\",NORTH],"
|
2024-09-11 23:55:47 +02:00
|
|
|
|
+ $"AUTHORITY[\"EPSG\",\"269{zone:00}\"]]";
|
2022-12-14 18:02:19 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|