2026-01-13 10:42:54 +01:00
|
|
|
|
using System;
|
2022-01-23 14:02:04 +01:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl.Projections
|
|
|
|
|
|
{
|
2022-12-14 18:02:19 +01:00
|
|
|
|
/// <summary>
|
2026-01-10 08:28:10 +01:00
|
|
|
|
/// ETRS89 Universal Transverse Mercator Projection.
|
2022-12-14 18:02:19 +01:00
|
|
|
|
/// </summary>
|
2026-01-15 11:04:11 +01:00
|
|
|
|
public class Etrs89UtmProjection : ProjNetMapProjection
|
2022-01-23 14:02:04 +01:00
|
|
|
|
{
|
2022-12-14 18:02:19 +01:00
|
|
|
|
public const int FirstZone = 28;
|
|
|
|
|
|
public const int LastZone = 38;
|
|
|
|
|
|
public const int FirstZoneEpsgCode = 25800 + FirstZone;
|
|
|
|
|
|
public const int LastZoneEpsgCode = 25800 + LastZone;
|
|
|
|
|
|
|
|
|
|
|
|
public int Zone { get; }
|
|
|
|
|
|
|
2022-01-23 14:02:04 +01:00
|
|
|
|
public Etrs89UtmProjection(int zone)
|
|
|
|
|
|
{
|
2022-12-14 18:02:19 +01:00
|
|
|
|
if (zone < FirstZone || zone > LastZone)
|
2022-01-23 14:02:04 +01:00
|
|
|
|
{
|
2022-12-14 18:02:19 +01:00
|
|
|
|
throw new ArgumentException($"Invalid ETRS89 UTM zone {zone}.", nameof(zone));
|
2022-01-23 14:02:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-12-14 18:02:19 +01:00
|
|
|
|
Zone = zone;
|
2022-12-13 18:22:18 +01:00
|
|
|
|
CoordinateSystemWkt
|
|
|
|
|
|
= $"PROJCS[\"ETRS89 / UTM zone {zone}N\","
|
2026-01-16 09:45:48 +01:00
|
|
|
|
+ WktConstants.GeogCsEtrs89 + ","
|
2026-01-15 21:48:53 +01:00
|
|
|
|
+ "PROJECTION[\"Transverse_Mercator\"],"
|
2022-01-23 14:02:04 +01:00
|
|
|
|
+ "PARAMETER[\"latitude_of_origin\",0],"
|
2022-12-13 18:22:18 +01:00
|
|
|
|
+ $"PARAMETER[\"central_meridian\",{6 * zone - 183}],"
|
2022-01-23 14:02:04 +01:00
|
|
|
|
+ "PARAMETER[\"scale_factor\",0.9996],"
|
|
|
|
|
|
+ "PARAMETER[\"false_easting\",500000],"
|
|
|
|
|
|
+ "PARAMETER[\"false_northing\",0],"
|
2026-01-15 21:48:53 +01:00
|
|
|
|
+ "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
|
|
|
|
|
|
+ "AXIS[\"Easting\",EAST],"
|
|
|
|
|
|
+ "AXIS[\"Northing\",NORTH],"
|
2024-09-11 23:55:47 +02:00
|
|
|
|
+ $"AUTHORITY[\"EPSG\",\"258{zone:00}\"]]";
|
2022-01-23 14:02:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|