XAML-Map-Control/MapProjections/Shared/Wgs84UtmProjection.cs

23 lines
624 B
C#
Raw Normal View History

// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
2022-01-14 20:22:56 +01:00
// © 2022 Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
2018-12-20 21:55:12 +01:00
using ProjNet.CoordinateSystems;
2022-01-21 00:17:01 +01:00
using System;
namespace MapControl.Projections
{
2022-01-23 14:02:04 +01:00
public class Wgs84UtmProjection : GeoApiProjection
{
2022-01-23 14:02:04 +01:00
public Wgs84UtmProjection(int zone, bool north)
{
2022-01-21 00:17:01 +01:00
if (zone < 1 || zone > 60)
{
2022-01-23 14:02:04 +01:00
throw new ArgumentException($"Invalid UTM zone {zone}.", nameof(zone));
2022-01-21 00:17:01 +01:00
}
2022-01-21 00:17:01 +01:00
CoordinateSystem = ProjectedCoordinateSystem.WGS84_UTM(zone, north);
}
}
}