mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Added Etrs89UtmProjection
This commit is contained in:
parent
45b5d037bb
commit
0896209e22
4 changed files with 66 additions and 52 deletions
27
MapProjections/Shared/Wgs84UtmProjection.cs
Normal file
27
MapProjections/Shared/Wgs84UtmProjection.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue