Added Etrs89UtmProjection

This commit is contained in:
Clemens 2022-01-23 14:02:04 +01:00
parent 45b5d037bb
commit 0896209e22
4 changed files with 66 additions and 52 deletions

View file

@ -0,0 +1,27 @@
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// © 2022 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using ProjNet.CoordinateSystems;
using System;
namespace MapControl.Projections
{
public class Wgs84UtmProjection : GeoApiProjection
{
public Wgs84UtmProjection(int zone, bool north)
{
SetZone(zone, north);
}
protected void SetZone(int zone, bool north)
{
if (zone < 1 || zone > 60)
{
throw new ArgumentException($"Invalid UTM zone {zone}.", nameof(zone));
}
CoordinateSystem = ProjectedCoordinateSystem.WGS84_UTM(zone, north);
}
}
}