mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
Extend map projections
This commit is contained in:
parent
57e614978b
commit
d8d1cbccaf
27 changed files with 448 additions and 207 deletions
50
MapProjections/Shared/Nad27UtmProjection.cs
Normal file
50
MapProjections/Shared/Nad27UtmProjection.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
||||
// © 2022 Clemens Fischer
|
||||
// Licensed under the Microsoft Public License (Ms-PL)
|
||||
|
||||
using System;
|
||||
|
||||
namespace MapControl.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// NAD27 UTM Projection with zone number.
|
||||
/// </summary>
|
||||
public class Nad27UtmProjection : GeoApiProjection
|
||||
{
|
||||
public const int FirstZone = 1;
|
||||
public const int LastZone = 22;
|
||||
public const int FirstZoneEpsgCode = 26700 + FirstZone;
|
||||
public const int LastZoneEpsgCode = 26700 + LastZone;
|
||||
|
||||
public int Zone { get; }
|
||||
|
||||
public Nad27UtmProjection(int zone)
|
||||
{
|
||||
if (zone < FirstZone || zone > LastZone)
|
||||
{
|
||||
throw new ArgumentException($"Invalid NAD27 UTM zone {zone}.", nameof(zone));
|
||||
}
|
||||
|
||||
Zone = zone;
|
||||
CoordinateSystemWkt
|
||||
= $"PROJCS[\"NAD27 / UTM zone {zone}N\","
|
||||
+ "GEOGCS[\"NAD27\","
|
||||
+ "DATUM[\"North_American_Datum_1927\","
|
||||
+ "SPHEROID[\"Clarke 1866\",6378206.4,294.978698213898],"
|
||||
+ "]," //"EXTENSION[\"PROJ4_GRIDS\",\"NTv2_0.gsb\"]]," -- not recognized
|
||||
+ "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],"
|
||||
+ "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],"
|
||||
+ "AUTHORITY[\"EPSG\",\"4267\"]],"
|
||||
+ "PROJECTION[\"Transverse_Mercator\"],"
|
||||
+ "PARAMETER[\"latitude_of_origin\",0],"
|
||||
+ $"PARAMETER[\"central_meridian\",{6 * zone - 183}],"
|
||||
+ "PARAMETER[\"scale_factor\",0.9996],"
|
||||
+ "PARAMETER[\"false_easting\",500000],"
|
||||
+ "PARAMETER[\"false_northing\",0],"
|
||||
+ "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],"
|
||||
+ "AXIS[\"Easting\",EAST],"
|
||||
+ "AXIS[\"Northing\",NORTH],"
|
||||
+ $"AUTHORITY[\"EPSG\",\"267{zone}\"]]";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue