mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-05-07 13:37:47 +00:00
New TransverseMercatorProjection implementation
This commit is contained in:
parent
caa25cb471
commit
9c69deb782
9 changed files with 357 additions and 23 deletions
40
MapControl/Shared/Etrs89UtmProjection.cs
Normal file
40
MapControl/Shared/Etrs89UtmProjection.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// Copyright © 2024 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
|
||||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// ETRS89 UTM Projection with zone number.
|
||||
/// </summary>
|
||||
public class Etrs89UtmProjection : TransverseMercatorProjection
|
||||
{
|
||||
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; }
|
||||
|
||||
public Etrs89UtmProjection(int zone)
|
||||
{
|
||||
if (zone < FirstZone || zone > LastZone)
|
||||
{
|
||||
throw new ArgumentException($"Invalid ETRS89 UTM zone {zone}.", nameof(zone));
|
||||
}
|
||||
|
||||
Zone = zone;
|
||||
CrsId = $"EPSG:{25800 + Zone}";
|
||||
|
||||
// GRS 1980
|
||||
EquatorialRadius = 6378137d;
|
||||
Flattening = 1d / 298.257222101;
|
||||
ScaleFactor = 0.9996;
|
||||
CentralMeridian = Zone * 6d - 183d;
|
||||
FalseEasting = 5e5;
|
||||
FalseNorthing = 0d;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue