File scoped namespaces

This commit is contained in:
ClemensFischer 2026-04-13 17:14:49 +02:00
parent c14377f976
commit 65aba44af6
152 changed files with 11962 additions and 12115 deletions

View file

@ -8,211 +8,210 @@ using System.Windows.Media;
using Avalonia;
#endif
namespace MapControl.Projections
namespace MapControl.Projections;
/// <summary>
/// MapProjection based on ProjNet.
/// </summary>
public class ProjNetMapProjection : MapProjection
{
/// <summary>
/// MapProjection based on ProjNet.
/// </summary>
public class ProjNetMapProjection : MapProjection
public ProjNetMapProjection(ProjectedCoordinateSystem coordinateSystem)
{
public ProjNetMapProjection(ProjectedCoordinateSystem coordinateSystem)
CoordinateSystem = coordinateSystem;
}
public ProjNetMapProjection(string coordinateSystemWkt)
{
CoordinateSystemWkt = coordinateSystemWkt;
}
/// <summary>
/// Gets or sets an OGC Well-known text representation of a coordinate system,
/// i.e. a PROJCS[...] or GEOGCS[...] string as used by https://epsg.io or http://spatialreference.org.
/// Setting this property updates the CoordinateSystem property with an ICoordinateSystem created from the WKT string.
/// </summary>
public string CoordinateSystemWkt
{
get => CoordinateSystem?.WKT;
protected set => CoordinateSystem = new CoordinateSystemFactory().CreateFromWkt(value) as ProjectedCoordinateSystem;
}
/// <summary>
/// Gets or sets the ICoordinateSystem of the MapProjection.
/// </summary>
public ProjectedCoordinateSystem CoordinateSystem
{
get;
protected set
{
CoordinateSystem = coordinateSystem;
}
field = value ??
throw new ArgumentNullException(nameof(value));
public ProjNetMapProjection(string coordinateSystemWkt)
{
CoordinateSystemWkt = coordinateSystemWkt;
}
var projection = field.Projection ??
throw new ArgumentException("CoordinateSystem.Projection must not be null.", nameof(value));
/// <summary>
/// Gets or sets an OGC Well-known text representation of a coordinate system,
/// i.e. a PROJCS[...] or GEOGCS[...] string as used by https://epsg.io or http://spatialreference.org.
/// Setting this property updates the CoordinateSystem property with an ICoordinateSystem created from the WKT string.
/// </summary>
public string CoordinateSystemWkt
{
get => CoordinateSystem?.WKT;
protected set => CoordinateSystem = new CoordinateSystemFactory().CreateFromWkt(value) as ProjectedCoordinateSystem;
}
IsNormalCylindrical = projection.Name.Contains("Pseudo-Mercator") ||
projection.Name.StartsWith("Mercator");
/// <summary>
/// Gets or sets the ICoordinateSystem of the MapProjection.
/// </summary>
public ProjectedCoordinateSystem CoordinateSystem
{
get;
protected set
{
field = value ??
throw new ArgumentNullException(nameof(value));
var transformFactory = new CoordinateTransformationFactory();
var projection = field.Projection ??
throw new ArgumentException("CoordinateSystem.Projection must not be null.", nameof(value));
CrsId = !string.IsNullOrEmpty(field.Authority) && field.AuthorityCode > 0
? $"{field.Authority}:{field.AuthorityCode}"
: string.Empty;
IsNormalCylindrical = projection.Name.Contains("Pseudo-Mercator") ||
projection.Name.StartsWith("Mercator");
LocationToMapTransform = transformFactory
.CreateFromCoordinateSystems(GeographicCoordinateSystem.WGS84, field)
.MathTransform;
var transformFactory = new CoordinateTransformationFactory();
MapToLocationTransform = transformFactory
.CreateFromCoordinateSystems(field, GeographicCoordinateSystem.WGS84)
.MathTransform;
CrsId = !string.IsNullOrEmpty(field.Authority) && field.AuthorityCode > 0
? $"{field.Authority}:{field.AuthorityCode}"
: string.Empty;
var ellipsoid = field.HorizontalDatum.Ellipsoid;
EquatorialRadius = ellipsoid.SemiMajorAxis;
Flattening = 1d / ellipsoid.InverseFlattening;
LocationToMapTransform = transformFactory
.CreateFromCoordinateSystems(GeographicCoordinateSystem.WGS84, field)
.MathTransform;
var parameter = projection.GetParameter("scale_factor");
ScaleFactor = parameter != null ? parameter.Value : 1d;
MapToLocationTransform = transformFactory
.CreateFromCoordinateSystems(field, GeographicCoordinateSystem.WGS84)
.MathTransform;
parameter = projection.GetParameter("central_meridian");
CentralMeridian = parameter != null ? parameter.Value : 0d;
var ellipsoid = field.HorizontalDatum.Ellipsoid;
EquatorialRadius = ellipsoid.SemiMajorAxis;
Flattening = 1d / ellipsoid.InverseFlattening;
parameter = projection.GetParameter("latitude_of_origin");
LatitudeOfOrigin = parameter != null ? parameter.Value : 0d;
var parameter = projection.GetParameter("scale_factor");
ScaleFactor = parameter != null ? parameter.Value : 1d;
parameter = projection.GetParameter("false_easting");
FalseEasting = parameter != null ? parameter.Value : 0d;
parameter = projection.GetParameter("central_meridian");
CentralMeridian = parameter != null ? parameter.Value : 0d;
parameter = projection.GetParameter("latitude_of_origin");
LatitudeOfOrigin = parameter != null ? parameter.Value : 0d;
parameter = projection.GetParameter("false_easting");
FalseEasting = parameter != null ? parameter.Value : 0d;
parameter = projection.GetParameter("false_northing");
FalseNorthing = parameter != null ? parameter.Value : 0d;
}
}
public MathTransform LocationToMapTransform { get; private set; }
public MathTransform MapToLocationTransform { get; private set; }
public override Point LocationToMap(double latitude, double longitude)
{
if (LocationToMapTransform == null)
{
throw new InvalidOperationException("The CoordinateSystem property is not set.");
}
double x, y;
try
{
(x, y) = LocationToMapTransform.Transform(longitude, latitude);
}
catch (ArgumentException)
{
x = 0d;
y = latitude >= 0d ? double.PositiveInfinity : double.NegativeInfinity;
}
return new Point(x, y);
}
public override Location MapToLocation(double x, double y)
{
if (MapToLocationTransform == null)
{
throw new InvalidOperationException("The CoordinateSystem property is not set.");
}
(var lon, var lat) = MapToLocationTransform.Transform(x, y);
return new Location(lat, lon);
}
public override double GridConvergence(double latitude, double longitude)
{
var projection = CoordinateSystem.Projection.Name;
if (projection.StartsWith("Transverse_Mercator"))
{
return TransverseMercatorGridConvergence(latitude, longitude);
}
if (projection.StartsWith("Polar_Stereographic"))
{
return PolarStereographicGridConvergence(longitude);
}
return base.GridConvergence(latitude, longitude);
}
public override Matrix RelativeTransform(double latitude, double longitude)
{
var projection = CoordinateSystem.Projection.Name;
if (projection.Contains("Pseudo-Mercator"))
{
return WebMercatorRelativeTransform(latitude);
}
if (projection.StartsWith("Mercator"))
{
return WorldMercatorRelativeTransform(latitude);
}
if (projection.StartsWith("Polar_Stereographic"))
{
return PolarStereographicRelativeTransform(latitude, longitude);
}
return base.RelativeTransform(latitude, longitude);
}
protected static Matrix WebMercatorRelativeTransform(double latitude)
{
var k = 1d / Math.Cos(latitude * Math.PI / 180d); // p.44 (7-3)
return new Matrix(k, 0d, 0d, k, 0d, 0d);
}
protected Matrix WorldMercatorRelativeTransform(double latitude)
{
var e2 = (2d - Flattening) * Flattening;
var phi = latitude * Math.PI / 180d;
var sinPhi = Math.Sin(phi);
var k = Math.Sqrt(1d - e2 * sinPhi * sinPhi) / Math.Cos(phi); // p.44 (7-8)
return new Matrix(k, 0d, 0d, k, 0d, 0d);
}
protected double TransverseMercatorGridConvergence(double latitude, double longitude)
{
return 180d / Math.PI * Math.Atan(
Math.Tan((longitude - CentralMeridian) * Math.PI / 180d) *
Math.Sin(latitude * Math.PI / 180d));
}
protected double PolarStereographicGridConvergence(double longitude)
{
return Math.Sign(LatitudeOfOrigin) * (longitude - CentralMeridian);
}
protected Matrix PolarStereographicRelativeTransform(double latitude, double longitude)
{
var sign = Math.Sign(LatitudeOfOrigin);
var phi = sign * latitude * Math.PI / 180d;
var e = Math.Sqrt((2d - Flattening) * Flattening);
var eSinPhi = e * Math.Sin(phi);
var t = Math.Tan(Math.PI / 4d - phi / 2d)
/ Math.Pow((1d - eSinPhi) / (1d + eSinPhi), e / 2d); // p.161 (15-9)
// r == ρ/a
var r = 2d * ScaleFactor * t / Math.Sqrt(Math.Pow(1d + e, 1d + e) * Math.Pow(1d - e, 1d - e)); // p.161 (21-33)
var m = Math.Cos(phi) / Math.Sqrt(1d - eSinPhi * eSinPhi); // p.160 (14-15)
var k = r / m; // p.161 (21-32)
var transform = new Matrix(k, 0d, 0d, k, 0d, 0d);
transform.Rotate(-sign * (longitude - CentralMeridian));
return transform;
parameter = projection.GetParameter("false_northing");
FalseNorthing = parameter != null ? parameter.Value : 0d;
}
}
public MathTransform LocationToMapTransform { get; private set; }
public MathTransform MapToLocationTransform { get; private set; }
public override Point LocationToMap(double latitude, double longitude)
{
if (LocationToMapTransform == null)
{
throw new InvalidOperationException("The CoordinateSystem property is not set.");
}
double x, y;
try
{
(x, y) = LocationToMapTransform.Transform(longitude, latitude);
}
catch (ArgumentException)
{
x = 0d;
y = latitude >= 0d ? double.PositiveInfinity : double.NegativeInfinity;
}
return new Point(x, y);
}
public override Location MapToLocation(double x, double y)
{
if (MapToLocationTransform == null)
{
throw new InvalidOperationException("The CoordinateSystem property is not set.");
}
(var lon, var lat) = MapToLocationTransform.Transform(x, y);
return new Location(lat, lon);
}
public override double GridConvergence(double latitude, double longitude)
{
var projection = CoordinateSystem.Projection.Name;
if (projection.StartsWith("Transverse_Mercator"))
{
return TransverseMercatorGridConvergence(latitude, longitude);
}
if (projection.StartsWith("Polar_Stereographic"))
{
return PolarStereographicGridConvergence(longitude);
}
return base.GridConvergence(latitude, longitude);
}
public override Matrix RelativeTransform(double latitude, double longitude)
{
var projection = CoordinateSystem.Projection.Name;
if (projection.Contains("Pseudo-Mercator"))
{
return WebMercatorRelativeTransform(latitude);
}
if (projection.StartsWith("Mercator"))
{
return WorldMercatorRelativeTransform(latitude);
}
if (projection.StartsWith("Polar_Stereographic"))
{
return PolarStereographicRelativeTransform(latitude, longitude);
}
return base.RelativeTransform(latitude, longitude);
}
protected static Matrix WebMercatorRelativeTransform(double latitude)
{
var k = 1d / Math.Cos(latitude * Math.PI / 180d); // p.44 (7-3)
return new Matrix(k, 0d, 0d, k, 0d, 0d);
}
protected Matrix WorldMercatorRelativeTransform(double latitude)
{
var e2 = (2d - Flattening) * Flattening;
var phi = latitude * Math.PI / 180d;
var sinPhi = Math.Sin(phi);
var k = Math.Sqrt(1d - e2 * sinPhi * sinPhi) / Math.Cos(phi); // p.44 (7-8)
return new Matrix(k, 0d, 0d, k, 0d, 0d);
}
protected double TransverseMercatorGridConvergence(double latitude, double longitude)
{
return 180d / Math.PI * Math.Atan(
Math.Tan((longitude - CentralMeridian) * Math.PI / 180d) *
Math.Sin(latitude * Math.PI / 180d));
}
protected double PolarStereographicGridConvergence(double longitude)
{
return Math.Sign(LatitudeOfOrigin) * (longitude - CentralMeridian);
}
protected Matrix PolarStereographicRelativeTransform(double latitude, double longitude)
{
var sign = Math.Sign(LatitudeOfOrigin);
var phi = sign * latitude * Math.PI / 180d;
var e = Math.Sqrt((2d - Flattening) * Flattening);
var eSinPhi = e * Math.Sin(phi);
var t = Math.Tan(Math.PI / 4d - phi / 2d)
/ Math.Pow((1d - eSinPhi) / (1d + eSinPhi), e / 2d); // p.161 (15-9)
// r == ρ/a
var r = 2d * ScaleFactor * t / Math.Sqrt(Math.Pow(1d + e, 1d + e) * Math.Pow(1d - e, 1d - e)); // p.161 (21-33)
var m = Math.Cos(phi) / Math.Sqrt(1d - eSinPhi * eSinPhi); // p.160 (14-15)
var k = r / m; // p.161 (21-32)
var transform = new Matrix(k, 0d, 0d, k, 0d, 0d);
transform.Rotate(-sign * (longitude - CentralMeridian));
return transform;
}
}

View file

@ -1,243 +1,242 @@
using ProjNet.CoordinateSystems;
using System.Collections.Generic;
namespace MapControl.Projections
namespace MapControl.Projections;
public class ProjNetMapProjectionFactory : MapProjectionFactory
{
public class ProjNetMapProjectionFactory : MapProjectionFactory
public Dictionary<int, string> CoordinateSystemWkts { get; } = new Dictionary<int, string>
{
public Dictionary<int, string> CoordinateSystemWkts { get; } = new Dictionary<int, string>
{ 2056, WktConstants.ProjCsCh1903Lv95 },
{ 2100, WktConstants.ProjCsGgrs87 },
{ 2180, WktConstants.ProjCsEtrf2000Pl },
{ 3034, WktConstants.ProjCsEtrs89LccEurope },
{ 3035, WktConstants.ProjCsEtrs89LaeaEurope },
{ 4647, WktConstants.ProjCsEtrs89Utm32NzEN },
{ 4839, WktConstants.ProjCsEtrs89LccGermanyNE },
{ 5243, WktConstants.ProjCsEtrs89LccGermanyEN },
{ 21781, WktConstants.ProjCsCh1903Lv03 },
{ 29187, WktConstants.ProjCsSad69Utm17S },
{ 29188, WktConstants.ProjCsSad69Utm18S },
{ 29189, WktConstants.ProjCsSad69Utm19S },
{ 29190, WktConstants.ProjCsSad69Utm20S },
{ 29191, WktConstants.ProjCsSad69Utm21S },
{ 29192, WktConstants.ProjCsSad69Utm22S },
{ 29193, WktConstants.ProjCsSad69Utm23S },
};
protected override MapProjection CreateProjection(string crsId)
{
return crsId switch
{
{ 2056, WktConstants.ProjCsCh1903Lv95 },
{ 2100, WktConstants.ProjCsGgrs87 },
{ 2180, WktConstants.ProjCsEtrf2000Pl },
{ 3034, WktConstants.ProjCsEtrs89LccEurope },
{ 3035, WktConstants.ProjCsEtrs89LaeaEurope },
{ 4647, WktConstants.ProjCsEtrs89Utm32NzEN },
{ 4839, WktConstants.ProjCsEtrs89LccGermanyNE },
{ 5243, WktConstants.ProjCsEtrs89LccGermanyEN },
{ 21781, WktConstants.ProjCsCh1903Lv03 },
{ 29187, WktConstants.ProjCsSad69Utm17S },
{ 29188, WktConstants.ProjCsSad69Utm18S },
{ 29189, WktConstants.ProjCsSad69Utm19S },
{ 29190, WktConstants.ProjCsSad69Utm20S },
{ 29191, WktConstants.ProjCsSad69Utm21S },
{ 29192, WktConstants.ProjCsSad69Utm22S },
{ 29193, WktConstants.ProjCsSad69Utm23S },
WebMercatorProjection.DefaultCrsId => new WebMercatorProjection(),
WorldMercatorProjection.DefaultCrsId => new WorldMercatorProjection(),
Wgs84UpsNorthProjection.DefaultCrsId => new Wgs84UpsNorthProjection(),
Wgs84UpsSouthProjection.DefaultCrsId => new Wgs84UpsSouthProjection(),
_ => base.CreateProjection(crsId)
};
}
protected override MapProjection CreateProjection(string crsId)
protected override MapProjection CreateProjection(int epsgCode)
{
if (CoordinateSystemWkts.TryGetValue(epsgCode, out string wkt))
{
return crsId switch
{
WebMercatorProjection.DefaultCrsId => new WebMercatorProjection(),
WorldMercatorProjection.DefaultCrsId => new WorldMercatorProjection(),
Wgs84UpsNorthProjection.DefaultCrsId => new Wgs84UpsNorthProjection(),
Wgs84UpsSouthProjection.DefaultCrsId => new Wgs84UpsSouthProjection(),
_ => base.CreateProjection(crsId)
};
return new ProjNetMapProjection(wkt);
}
protected override MapProjection CreateProjection(int epsgCode)
return epsgCode switch
{
if (CoordinateSystemWkts.TryGetValue(epsgCode, out string wkt))
{
return new ProjNetMapProjection(wkt);
}
return epsgCode switch
{
var c when c is >= Ed50UtmProjection.FirstZoneEpsgCode
and <= Ed50UtmProjection.LastZoneEpsgCode => new Ed50UtmProjection(c % 100),
var c when c is >= Etrs89UtmProjection.FirstZoneEpsgCode
and <= Etrs89UtmProjection.LastZoneEpsgCode => new Etrs89UtmProjection(c % 100),
var c when c is >= Nad27UtmProjection.FirstZoneEpsgCode
and <= Nad27UtmProjection.LastZoneEpsgCode => new Nad27UtmProjection(c % 100),
var c when c is >= Nad83UtmProjection.FirstZoneEpsgCode
and <= Nad83UtmProjection.LastZoneEpsgCode => new Nad83UtmProjection(c % 100),
var c when c is >= Wgs84UtmProjection.FirstZoneNorthEpsgCode
and <= Wgs84UtmProjection.LastZoneNorthEpsgCode => new Wgs84UtmProjection(c % 100, true),
var c when c is >= Wgs84UtmProjection.FirstZoneSouthEpsgCode
and <= Wgs84UtmProjection.LastZoneSouthEpsgCode => new Wgs84UtmProjection(c % 100, false),
_ => base.CreateProjection(epsgCode)
};
}
}
/// <summary>
/// Spherical Mercator Projection - EPSG:3857,
/// implemented by setting the CoordinateSystem property of a ProjNetMapProjection.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.41-44.
/// </summary>
public class WebMercatorProjection() : ProjNetMapProjection(ProjectedCoordinateSystem.WebMercator)
{
public const string DefaultCrsId = "EPSG:3857";
}
/// <summary>
/// Elliptical Mercator Projection - EPSG:3395,
/// implemented by setting the CoordinateSystemWkt property of a ProjNetMapProjection.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.44-45.
/// </summary>
public class WorldMercatorProjection() : ProjNetMapProjection(
"PROJCS[\"WGS 84 / World Mercator\"," +
WktConstants.GeogCsWgs84 + "," +
"PROJECTION[\"Mercator_1SP\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",0]," +
"PARAMETER[\"scale_factor\",1]," +
"PARAMETER[\"false_easting\",0]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"3395\"]]")
{
public const string DefaultCrsId = "EPSG:3395";
}
/// <summary>
/// WGS84 Universal Transverse Mercator Projection -
/// EPSG:32601 to EPSG:32660 and EPSG:32701 to EPSG:32760.
/// </summary>
public class Wgs84UtmProjection(int zone, bool north) : ProjNetMapProjection(
ProjectedCoordinateSystem.WGS84_UTM(zone, north))
{
public const int FirstZone = 1;
public const int LastZone = 60;
public const int FirstZoneNorthEpsgCode = 32600 + FirstZone;
public const int LastZoneNorthEpsgCode = 32600 + LastZone;
public const int FirstZoneSouthEpsgCode = 32700 + FirstZone;
public const int LastZoneSouthEpsgCode = 32700 + LastZone;
public int Zone => zone;
}
/// <summary>
/// ETRS89 Universal Transverse Mercator Projection - EPSG:25828 to EPSG:25838.
/// </summary>
public class Etrs89UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"ETRS89 / UTM zone {zone}N\"," +
WktConstants.GeogCsEtrs89 + "," +
"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\",\"258{zone:00}\"]]")
{
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 => zone;
}
/// <summary>
/// NAD83 Universal Transverse Mercator Projection - EPSG:26901 to EPSG:26923.
/// </summary>
public class Nad83UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"NAD83 / UTM zone {zone}N\"," +
WktConstants.GeogCsNad83 + "," +
"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\",\"269{zone:00}\"]]")
{
public const int FirstZone = 1;
public const int LastZone = 23;
public const int FirstZoneEpsgCode = 26900 + FirstZone;
public const int LastZoneEpsgCode = 26900 + LastZone;
public int Zone => zone;
}
/// <summary>
/// NAD27 Universal Transverse Mercator Projection - EPSG:26701 to EPSG:26722.
/// </summary>
public class Nad27UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"NAD27 / UTM zone {zone}N\"," +
WktConstants.GeogCsNad27 + "," +
"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:00}\"]]")
{
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 => zone;
}
/// <summary>
/// ED50 Universal Transverse Mercator Projection.
/// </summary>
public class Ed50UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"ED50 / UTM zone {zone}N\"," +
WktConstants.GeogCsEd50 + "," +
"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\",\"230{zone:00}\"]]")
{
public const int FirstZone = 28;
public const int LastZone = 38;
public const int FirstZoneEpsgCode = 23000 + FirstZone;
public const int LastZoneEpsgCode = 23000 + LastZone;
public int Zone { get; } = zone;
}
public class Wgs84UpsNorthProjection() : ProjNetMapProjection(
"PROJCS[\"WGS 84 / UPS North (N,E)\"," +
WktConstants.GeogCsWgs84 + "," +
"PROJECTION[\"Polar_Stereographic\"]," +
"PARAMETER[\"latitude_of_origin\",90]," +
"PARAMETER[\"central_meridian\",0]," +
"PARAMETER[\"scale_factor\",0.994]," +
"PARAMETER[\"false_easting\",2000000]," +
"PARAMETER[\"false_northing\",2000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"32661\"]]")
{
public const string DefaultCrsId = "EPSG:32661";
}
public class Wgs84UpsSouthProjection() : ProjNetMapProjection(
"PROJCS[\"WGS 84 / UPS South (N,E)\"," +
WktConstants.GeogCsWgs84 + "," +
"PROJECTION[\"Polar_Stereographic\"]," +
"PARAMETER[\"latitude_of_origin\",-90]," +
"PARAMETER[\"central_meridian\",0]," +
"PARAMETER[\"scale_factor\",0.994]," +
"PARAMETER[\"false_easting\",2000000]," +
"PARAMETER[\"false_northing\",2000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"32761\"]]")
{
public const string DefaultCrsId = "EPSG:32761";
var c when c is >= Ed50UtmProjection.FirstZoneEpsgCode
and <= Ed50UtmProjection.LastZoneEpsgCode => new Ed50UtmProjection(c % 100),
var c when c is >= Etrs89UtmProjection.FirstZoneEpsgCode
and <= Etrs89UtmProjection.LastZoneEpsgCode => new Etrs89UtmProjection(c % 100),
var c when c is >= Nad27UtmProjection.FirstZoneEpsgCode
and <= Nad27UtmProjection.LastZoneEpsgCode => new Nad27UtmProjection(c % 100),
var c when c is >= Nad83UtmProjection.FirstZoneEpsgCode
and <= Nad83UtmProjection.LastZoneEpsgCode => new Nad83UtmProjection(c % 100),
var c when c is >= Wgs84UtmProjection.FirstZoneNorthEpsgCode
and <= Wgs84UtmProjection.LastZoneNorthEpsgCode => new Wgs84UtmProjection(c % 100, true),
var c when c is >= Wgs84UtmProjection.FirstZoneSouthEpsgCode
and <= Wgs84UtmProjection.LastZoneSouthEpsgCode => new Wgs84UtmProjection(c % 100, false),
_ => base.CreateProjection(epsgCode)
};
}
}
/// <summary>
/// Spherical Mercator Projection - EPSG:3857,
/// implemented by setting the CoordinateSystem property of a ProjNetMapProjection.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.41-44.
/// </summary>
public class WebMercatorProjection() : ProjNetMapProjection(ProjectedCoordinateSystem.WebMercator)
{
public const string DefaultCrsId = "EPSG:3857";
}
/// <summary>
/// Elliptical Mercator Projection - EPSG:3395,
/// implemented by setting the CoordinateSystemWkt property of a ProjNetMapProjection.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.44-45.
/// </summary>
public class WorldMercatorProjection() : ProjNetMapProjection(
"PROJCS[\"WGS 84 / World Mercator\"," +
WktConstants.GeogCsWgs84 + "," +
"PROJECTION[\"Mercator_1SP\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",0]," +
"PARAMETER[\"scale_factor\",1]," +
"PARAMETER[\"false_easting\",0]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"3395\"]]")
{
public const string DefaultCrsId = "EPSG:3395";
}
/// <summary>
/// WGS84 Universal Transverse Mercator Projection -
/// EPSG:32601 to EPSG:32660 and EPSG:32701 to EPSG:32760.
/// </summary>
public class Wgs84UtmProjection(int zone, bool north) : ProjNetMapProjection(
ProjectedCoordinateSystem.WGS84_UTM(zone, north))
{
public const int FirstZone = 1;
public const int LastZone = 60;
public const int FirstZoneNorthEpsgCode = 32600 + FirstZone;
public const int LastZoneNorthEpsgCode = 32600 + LastZone;
public const int FirstZoneSouthEpsgCode = 32700 + FirstZone;
public const int LastZoneSouthEpsgCode = 32700 + LastZone;
public int Zone => zone;
}
/// <summary>
/// ETRS89 Universal Transverse Mercator Projection - EPSG:25828 to EPSG:25838.
/// </summary>
public class Etrs89UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"ETRS89 / UTM zone {zone}N\"," +
WktConstants.GeogCsEtrs89 + "," +
"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\",\"258{zone:00}\"]]")
{
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 => zone;
}
/// <summary>
/// NAD83 Universal Transverse Mercator Projection - EPSG:26901 to EPSG:26923.
/// </summary>
public class Nad83UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"NAD83 / UTM zone {zone}N\"," +
WktConstants.GeogCsNad83 + "," +
"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\",\"269{zone:00}\"]]")
{
public const int FirstZone = 1;
public const int LastZone = 23;
public const int FirstZoneEpsgCode = 26900 + FirstZone;
public const int LastZoneEpsgCode = 26900 + LastZone;
public int Zone => zone;
}
/// <summary>
/// NAD27 Universal Transverse Mercator Projection - EPSG:26701 to EPSG:26722.
/// </summary>
public class Nad27UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"NAD27 / UTM zone {zone}N\"," +
WktConstants.GeogCsNad27 + "," +
"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:00}\"]]")
{
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 => zone;
}
/// <summary>
/// ED50 Universal Transverse Mercator Projection.
/// </summary>
public class Ed50UtmProjection(int zone) : ProjNetMapProjection(
$"PROJCS[\"ED50 / UTM zone {zone}N\"," +
WktConstants.GeogCsEd50 + "," +
"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\",\"230{zone:00}\"]]")
{
public const int FirstZone = 28;
public const int LastZone = 38;
public const int FirstZoneEpsgCode = 23000 + FirstZone;
public const int LastZoneEpsgCode = 23000 + LastZone;
public int Zone { get; } = zone;
}
public class Wgs84UpsNorthProjection() : ProjNetMapProjection(
"PROJCS[\"WGS 84 / UPS North (N,E)\"," +
WktConstants.GeogCsWgs84 + "," +
"PROJECTION[\"Polar_Stereographic\"]," +
"PARAMETER[\"latitude_of_origin\",90]," +
"PARAMETER[\"central_meridian\",0]," +
"PARAMETER[\"scale_factor\",0.994]," +
"PARAMETER[\"false_easting\",2000000]," +
"PARAMETER[\"false_northing\",2000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"32661\"]]")
{
public const string DefaultCrsId = "EPSG:32661";
}
public class Wgs84UpsSouthProjection() : ProjNetMapProjection(
"PROJCS[\"WGS 84 / UPS South (N,E)\"," +
WktConstants.GeogCsWgs84 + "," +
"PROJECTION[\"Polar_Stereographic\"]," +
"PARAMETER[\"latitude_of_origin\",-90]," +
"PARAMETER[\"central_meridian\",0]," +
"PARAMETER[\"scale_factor\",0.994]," +
"PARAMETER[\"false_easting\",2000000]," +
"PARAMETER[\"false_northing\",2000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"32761\"]]")
{
public const string DefaultCrsId = "EPSG:32761";
}

View file

@ -1,326 +1,325 @@
namespace MapControl.Projections
namespace MapControl.Projections;
/// <summary>
/// Well-known text representations of geographic and projected coordinate systems
/// taken from epsg.io.
/// </summary>
public static class WktConstants
{
/// <summary>
/// Well-known text representations of geographic and projected coordinate systems
/// taken from epsg.io.
/// </summary>
public static class WktConstants
{
private const string PrimeMeridian = "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],";
private const string UnitDegree = "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],";
private const string PrimeMeridian = "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],";
private const string UnitDegree = "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],";
public const string SpheroidWgs84 = "SPHEROID[\"WGS 84\",6378137,298.257223563]";
public const string SpheroidGrs1980 = "SPHEROID[\"GRS 1980\",6378137,298.257222101]";
public const string SpheroidGrs1967Modified = "SPHEROID[\"GRS 1967 Modified\",6378160,298.25]";
public const string SpheroidInternational1924 = "SPHEROID[\"International 1924\",6378388,297]";
public const string SpheroidClarke1866 = "SPHEROID[\"Clarke 1866\",6378206.4,294.978698213898]";
public const string SpheroidBessel1841 = "SPHEROID[\"Bessel 1841\",6377397.155,299.1528128]";
public const string SpheroidWgs84 = "SPHEROID[\"WGS 84\",6378137,298.257223563]";
public const string SpheroidGrs1980 = "SPHEROID[\"GRS 1980\",6378137,298.257222101]";
public const string SpheroidGrs1967Modified = "SPHEROID[\"GRS 1967 Modified\",6378160,298.25]";
public const string SpheroidInternational1924 = "SPHEROID[\"International 1924\",6378388,297]";
public const string SpheroidClarke1866 = "SPHEROID[\"Clarke 1866\",6378206.4,294.978698213898]";
public const string SpheroidBessel1841 = "SPHEROID[\"Bessel 1841\",6377397.155,299.1528128]";
public const string GeogCsWgs84 =
"GEOGCS[\"WGS 84\"," +
"DATUM[\"WGS_1984\"," +
SpheroidWgs84 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4326\"]]";
public const string GeogCsWgs84 =
"GEOGCS[\"WGS 84\"," +
"DATUM[\"WGS_1984\"," +
SpheroidWgs84 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4326\"]]";
public const string GeogCsEd50 =
"GEOGCS[\"ED50\"," +
"DATUM[\"European_Datum_1950\"," +
SpheroidInternational1924 + "," +
"TOWGS84[-87,-98,-121,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4230\"]]";
public const string GeogCsEd50 =
"GEOGCS[\"ED50\"," +
"DATUM[\"European_Datum_1950\"," +
SpheroidInternational1924 + "," +
"TOWGS84[-87,-98,-121,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4230\"]]";
public const string GeogCsEtrs89 =
"GEOGCS[\"ETRS89\"," +
"DATUM[\"European_Terrestrial_Reference_System_1989\"," +
SpheroidGrs1980 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4258\"]]";
public const string GeogCsEtrs89 =
"GEOGCS[\"ETRS89\"," +
"DATUM[\"European_Terrestrial_Reference_System_1989\"," +
SpheroidGrs1980 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4258\"]]";
public const string GeogCsGgrs87 =
"GEOGCS[\"GGRS87\"," +
"DATUM[\"Greek_Geodetic_Reference_System_1987\"," +
SpheroidGrs1980 + "," +
"TOWGS84[-199.87,74.79,246.62,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4121\"]]";
public const string GeogCsGgrs87 =
"GEOGCS[\"GGRS87\"," +
"DATUM[\"Greek_Geodetic_Reference_System_1987\"," +
SpheroidGrs1980 + "," +
"TOWGS84[-199.87,74.79,246.62,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4121\"]]";
public const string GeogCsEtrf2000Pl =
"GEOGCS[\"ETRF2000-PL\"," +
"DATUM[\"ETRF2000_Poland\"," +
SpheroidGrs1980 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"9702\"]]";
public const string GeogCsEtrf2000Pl =
"GEOGCS[\"ETRF2000-PL\"," +
"DATUM[\"ETRF2000_Poland\"," +
SpheroidGrs1980 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"9702\"]]";
public const string GeogCsNad83 =
"GEOGCS[\"NAD83\"," +
"DATUM[\"North_American_Datum_1983\"," +
SpheroidGrs1980 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4269\"]]";
public const string GeogCsNad83 =
"GEOGCS[\"NAD83\"," +
"DATUM[\"North_American_Datum_1983\"," +
SpheroidGrs1980 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4269\"]]";
public const string GeogCsNad27 =
"GEOGCS[\"NAD27\"," +
"DATUM[\"North_American_Datum_1927\"," +
SpheroidClarke1866 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4267\"]]";
public const string GeogCsNad27 =
"GEOGCS[\"NAD27\"," +
"DATUM[\"North_American_Datum_1927\"," +
SpheroidClarke1866 + "]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4267\"]]";
public const string GeogCsSad69 =
"GEOGCS[\"SAD69\"," +
"DATUM[\"South_American_Datum_1969\"," +
SpheroidGrs1967Modified + "," +
"TOWGS84[-57,1,-41,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4618\"]]";
public const string GeogCsSad69 =
"GEOGCS[\"SAD69\"," +
"DATUM[\"South_American_Datum_1969\"," +
SpheroidGrs1967Modified + "," +
"TOWGS84[-57,1,-41,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4618\"]]";
public const string GeogCsSad69_96 =
"GEOGCS[\"SAD69\"," +
"DATUM[\"South_American_Datum_1969_96\"," +
SpheroidGrs1967Modified + "," +
"TOWGS84[-67.35,3.88,-38.22,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"5527\"]]";
public const string GeogCsSad69_96 =
"GEOGCS[\"SAD69\"," +
"DATUM[\"South_American_Datum_1969_96\"," +
SpheroidGrs1967Modified + "," +
"TOWGS84[-67.35,3.88,-38.22,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"5527\"]]";
public const string GeogCsCh1903 =
"GEOGCS[\"CH1903\"," +
"DATUM[\"CH1903\"," +
SpheroidBessel1841 + "," +
"TOWGS84[674.374,15.056,405.346,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4149\"]]";
public const string GeogCsCh1903 =
"GEOGCS[\"CH1903\"," +
"DATUM[\"CH1903\"," +
SpheroidBessel1841 + "," +
"TOWGS84[674.374,15.056,405.346,0,0,0,0]]," +
PrimeMeridian +
UnitDegree +
"AUTHORITY[\"EPSG\",\"4149\"]]";
public const string ProjCsGgrs87 =
"PROJCS[\"GGRS87 / Greek Grid\"," +
GeogCsGgrs87 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",24]," +
"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\",\"2100\"]]";
public const string ProjCsGgrs87 =
"PROJCS[\"GGRS87 / Greek Grid\"," +
GeogCsGgrs87 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",24]," +
"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\",\"2100\"]]";
public const string ProjCsEtrf2000Pl =
"PROJCS[\"ETRF2000-PL / CS92\"," +
GeogCsEtrf2000Pl + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",19]," +
"PARAMETER[\"scale_factor\",0.9993]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",-5300000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"2180\"]]";
public const string ProjCsEtrf2000Pl =
"PROJCS[\"ETRF2000-PL / CS92\"," +
GeogCsEtrf2000Pl + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",19]," +
"PARAMETER[\"scale_factor\",0.9993]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",-5300000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"2180\"]]";
public const string ProjCsEtrs89Utm32NzEN =
"PROJCS[\"ETRS89 / UTM zone 32N (zE-N)\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",9]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",32500000]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"4647\"]]";
public const string ProjCsEtrs89Utm32NzEN =
"PROJCS[\"ETRS89 / UTM zone 32N (zE-N)\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",9]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",32500000]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"4647\"]]";
public const string ProjCsEtrs89LccEurope =
"PROJCS[\"ETRS89-extended / LCC Europe\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Conformal_Conic_2SP\"]," +
"PARAMETER[\"latitude_of_origin\",52]," +
"PARAMETER[\"central_meridian\",10]," +
"PARAMETER[\"standard_parallel_1\",35]," +
"PARAMETER[\"standard_parallel_2\",65]," +
"PARAMETER[\"false_easting\",4000000]," +
"PARAMETER[\"false_northing\",2800000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"3034\"]]";
public const string ProjCsEtrs89LccEurope =
"PROJCS[\"ETRS89-extended / LCC Europe\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Conformal_Conic_2SP\"]," +
"PARAMETER[\"latitude_of_origin\",52]," +
"PARAMETER[\"central_meridian\",10]," +
"PARAMETER[\"standard_parallel_1\",35]," +
"PARAMETER[\"standard_parallel_2\",65]," +
"PARAMETER[\"false_easting\",4000000]," +
"PARAMETER[\"false_northing\",2800000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"3034\"]]";
public const string ProjCsEtrs89LaeaEurope =
"PROJCS[\"ETRS89-extended / LAEA Europe\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Azimuthal_Equal_Area\"]," +
"PARAMETER[\"latitude_of_center\",52]," +
"PARAMETER[\"longitude_of_center\",10]," +
"PARAMETER[\"false_easting\",4321000]," +
"PARAMETER[\"false_northing\",3210000]" +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"3035\"]]";
public const string ProjCsEtrs89LaeaEurope =
"PROJCS[\"ETRS89-extended / LAEA Europe\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Azimuthal_Equal_Area\"]," +
"PARAMETER[\"latitude_of_center\",52]," +
"PARAMETER[\"longitude_of_center\",10]," +
"PARAMETER[\"false_easting\",4321000]," +
"PARAMETER[\"false_northing\",3210000]" +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"3035\"]]";
public const string ProjCsEtrs89LccGermanyNE =
"PROJCS[\"ETRS89 / LCC Germany (N-E)\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Conformal_Conic_2SP\"]," +
"PARAMETER[\"latitude_of_origin\",51]," +
"PARAMETER[\"central_meridian\",10.5]," +
"PARAMETER[\"standard_parallel_1\",48.6666666666667]," +
"PARAMETER[\"standard_parallel_2\",53.6666666666667]," +
"PARAMETER[\"false_easting\",0]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"4839\"]]";
public const string ProjCsEtrs89LccGermanyNE =
"PROJCS[\"ETRS89 / LCC Germany (N-E)\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Conformal_Conic_2SP\"]," +
"PARAMETER[\"latitude_of_origin\",51]," +
"PARAMETER[\"central_meridian\",10.5]," +
"PARAMETER[\"standard_parallel_1\",48.6666666666667]," +
"PARAMETER[\"standard_parallel_2\",53.6666666666667]," +
"PARAMETER[\"false_easting\",0]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AUTHORITY[\"EPSG\",\"4839\"]]";
public const string ProjCsEtrs89LccGermanyEN =
"PROJCS[\"ETRS89 / LCC Germany (E-N)\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Conformal_Conic_2SP\"]," +
"PARAMETER[\"latitude_of_origin\",51]," +
"PARAMETER[\"central_meridian\",10.5]," +
"PARAMETER[\"standard_parallel_1\",48.6666666666667]," +
"PARAMETER[\"standard_parallel_2\",53.6666666666667]," +
"PARAMETER[\"false_easting\",0]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"5243\"]]";
public const string ProjCsEtrs89LccGermanyEN =
"PROJCS[\"ETRS89 / LCC Germany (E-N)\"," +
GeogCsEtrs89 + "," +
"PROJECTION[\"Lambert_Conformal_Conic_2SP\"]," +
"PARAMETER[\"latitude_of_origin\",51]," +
"PARAMETER[\"central_meridian\",10.5]," +
"PARAMETER[\"standard_parallel_1\",48.6666666666667]," +
"PARAMETER[\"standard_parallel_2\",53.6666666666667]," +
"PARAMETER[\"false_easting\",0]," +
"PARAMETER[\"false_northing\",0]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"5243\"]]";
public const string ProjCsCh1903Lv95 =
"PROJCS[\"CH1903 / LV95\"," +
GeogCsCh1903 + "," +
"PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"]," +
"PARAMETER[\"latitude_of_center\",46.9524055555556]," +
"PARAMETER[\"longitude_of_center\",7.43958333333333]," +
"PARAMETER[\"azimuth\",90]," +
"PARAMETER[\"rectified_grid_angle\",90]," +
"PARAMETER[\"scale_factor\",1]," +
"PARAMETER[\"false_easting\",2600000]," +
"PARAMETER[\"false_northing\",1200000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"2056\"]]";
public const string ProjCsCh1903Lv95 =
"PROJCS[\"CH1903 / LV95\"," +
GeogCsCh1903 + "," +
"PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"]," +
"PARAMETER[\"latitude_of_center\",46.9524055555556]," +
"PARAMETER[\"longitude_of_center\",7.43958333333333]," +
"PARAMETER[\"azimuth\",90]," +
"PARAMETER[\"rectified_grid_angle\",90]," +
"PARAMETER[\"scale_factor\",1]," +
"PARAMETER[\"false_easting\",2600000]," +
"PARAMETER[\"false_northing\",1200000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"2056\"]]";
public const string ProjCsCh1903Lv03 =
"PROJCS[\"CH1903 / LV03\"," +
GeogCsCh1903 + "," +
"PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"]," +
"PARAMETER[\"latitude_of_center\",46.9524055555556]," +
"PARAMETER[\"longitude_of_center\",7.43958333333333]," +
"PARAMETER[\"azimuth\",90]," +
"PARAMETER[\"rectified_grid_angle\",90]," +
"PARAMETER[\"scale_factor\",1]," +
"PARAMETER[\"false_easting\",600000]," +
"PARAMETER[\"false_northing\",200000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"21781\"]]";
public const string ProjCsCh1903Lv03 =
"PROJCS[\"CH1903 / LV03\"," +
GeogCsCh1903 + "," +
"PROJECTION[\"Hotine_Oblique_Mercator_Azimuth_Center\"]," +
"PARAMETER[\"latitude_of_center\",46.9524055555556]," +
"PARAMETER[\"longitude_of_center\",7.43958333333333]," +
"PARAMETER[\"azimuth\",90]," +
"PARAMETER[\"rectified_grid_angle\",90]," +
"PARAMETER[\"scale_factor\",1]," +
"PARAMETER[\"false_easting\",600000]," +
"PARAMETER[\"false_northing\",200000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"21781\"]]";
public const string ProjCsSad69Utm17S =
"PROJCS[\"SAD69 / UTM zone 17S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-81]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29187\"]]";
public const string ProjCsSad69Utm17S =
"PROJCS[\"SAD69 / UTM zone 17S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-81]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29187\"]]";
public const string ProjCsSad69Utm18S =
"PROJCS[\"SAD69 / UTM zone 18S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-75]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29188\"]]";
public const string ProjCsSad69Utm18S =
"PROJCS[\"SAD69 / UTM zone 18S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-75]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29188\"]]";
public const string ProjCsSad69Utm19S =
"PROJCS[\"SAD69 / UTM zone 19S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-69]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29189\"]]";
public const string ProjCsSad69Utm19S =
"PROJCS[\"SAD69 / UTM zone 19S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-69]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29189\"]]";
public const string ProjCsSad69Utm20S =
"PROJCS[\"SAD69 / UTM zone 20S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-63]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29190\"]]";
public const string ProjCsSad69Utm20S =
"PROJCS[\"SAD69 / UTM zone 20S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-63]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29190\"]]";
public const string ProjCsSad69Utm21S =
"PROJCS[\"SAD69 / UTM zone 21S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-57]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29191\"]]";
public const string ProjCsSad69Utm21S =
"PROJCS[\"SAD69 / UTM zone 21S\"," +
GeogCsSad69 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-57]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29191\"]]";
public const string ProjCsSad69Utm22S =
"PROJCS[\"SAD69 / UTM zone 22S\"," +
GeogCsSad69_96 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-51]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29192\"]]";
public const string ProjCsSad69Utm22S =
"PROJCS[\"SAD69 / UTM zone 22S\"," +
GeogCsSad69_96 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-51]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29192\"]]";
public const string ProjCsSad69Utm23S =
"PROJCS[\"SAD69 / UTM zone 23S\"," +
GeogCsSad69_96 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-45]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29193\"]]";
}
public const string ProjCsSad69Utm23S =
"PROJCS[\"SAD69 / UTM zone 23S\"," +
GeogCsSad69_96 + "," +
"PROJECTION[\"Transverse_Mercator\"]," +
"PARAMETER[\"latitude_of_origin\",0]," +
"PARAMETER[\"central_meridian\",-45]," +
"PARAMETER[\"scale_factor\",0.9996]," +
"PARAMETER[\"false_easting\",500000]," +
"PARAMETER[\"false_northing\",10000000]," +
"UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]," +
"AXIS[\"Easting\",EAST]," +
"AXIS[\"Northing\",NORTH]," +
"AUTHORITY[\"EPSG\",\"29193\"]]";
}