From d1706db78ac2290b01b9af5b70c8a11796e1e7a0 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Tue, 13 Jan 2026 10:41:04 +0100 Subject: [PATCH] Updated GeoApi projections --- MapProjections/Shared/Ed50UtmProjection.cs | 15 +++---- MapProjections/Shared/Etrs89UtmProjection.cs | 18 ++++----- .../Shared/GeoApiProjectionFactory.cs | 40 +++++++++---------- MapProjections/Shared/Nad27UtmProjection.cs | 12 +++--- MapProjections/Shared/Nad83UtmProjection.cs | 12 +++--- .../Shared/WorldMercatorProjection.cs | 18 +++------ 6 files changed, 51 insertions(+), 64 deletions(-) diff --git a/MapProjections/Shared/Ed50UtmProjection.cs b/MapProjections/Shared/Ed50UtmProjection.cs index 18ab4b18..e4912aba 100644 --- a/MapProjections/Shared/Ed50UtmProjection.cs +++ b/MapProjections/Shared/Ed50UtmProjection.cs @@ -1,4 +1,5 @@ -using System; +using ProjNet.CoordinateSystems; +using System; namespace MapControl.Projections { @@ -27,18 +28,18 @@ namespace MapControl.Projections + "GEOGCS[\"ED50\"," + "DATUM[\"European_Datum_1950\"," + "SPHEROID[\"International 1924\",6378388,297],TOWGS84[-87,-98,-121,0,0,0,0]]," - + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]]," - + "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]," + + GeoApiProjectionFactory.PrimeMeridian + "," + + GeoApiProjectionFactory.UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4230\"]]," - + "PROJECTION[\"Transverse_Mercator\"]," + + GeoApiProjectionFactory.ProjectionTM + "," + "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]," + + GeoApiProjectionFactory.UnitMeter + "," + + GeoApiProjectionFactory.AxisEast + "," + + GeoApiProjectionFactory.AxisNorth + "," + $"AUTHORITY[\"EPSG\",\"230{zone:00}\"]]"; } } diff --git a/MapProjections/Shared/Etrs89UtmProjection.cs b/MapProjections/Shared/Etrs89UtmProjection.cs index 9043dd9f..67c5e679 100644 --- a/MapProjections/Shared/Etrs89UtmProjection.cs +++ b/MapProjections/Shared/Etrs89UtmProjection.cs @@ -1,4 +1,5 @@ -using System; +using ProjNet.CoordinateSystems; +using System; namespace MapControl.Projections { @@ -24,21 +25,16 @@ namespace MapControl.Projections Zone = zone; CoordinateSystemWkt = $"PROJCS[\"ETRS89 / UTM zone {zone}N\"," - + "GEOGCS[\"ETRS89\"," - + "DATUM[\"European_Terrestrial_Reference_System_1989\"," - + "SPHEROID[\"GRS 1980\",6378137,298.257222101]]," - + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]]," - + "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]," - + "AUTHORITY[\"EPSG\",\"4258\"]]," - + "PROJECTION[\"Transverse_Mercator\"]," + + GeoApiProjectionFactory.GeoGcsETRS89 + "," + + GeoApiProjectionFactory.ProjectionTM + "," + "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]," + + GeoApiProjectionFactory.UnitMeter + "," + + GeoApiProjectionFactory.AxisEast + "," + + GeoApiProjectionFactory.AxisNorth + "," + $"AUTHORITY[\"EPSG\",\"258{zone:00}\"]]"; } } diff --git a/MapProjections/Shared/GeoApiProjectionFactory.cs b/MapProjections/Shared/GeoApiProjectionFactory.cs index 2b101202..b34af372 100644 --- a/MapProjections/Shared/GeoApiProjectionFactory.cs +++ b/MapProjections/Shared/GeoApiProjectionFactory.cs @@ -4,35 +4,33 @@ namespace MapControl.Projections { public class GeoApiProjectionFactory : MapProjectionFactory { - private const string SpheroidGRS1980 = "SPHEROID[\"GRS 1980\",6378137,298.257222101]"; - private const string SpheroidGRS1967Modified = "SPHEROID[\"GRS 1967 Modified\",6378160,298.25]"; - private const string PrimeMeridian = "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]]"; - private const string UnitDegree = "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]"; - private const string UnitMeter = "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]"; - private const string ProjectionTM = "PROJECTION[\"Transverse_Mercator\"]"; - private const string ProjectionLCC = "PROJECTION[\"Lambert_Conformal_Conic_2SP\"]"; - private const string AxisEast = "AXIS[\"Easting\",EAST]"; - private const string AxisNorth = "AXIS[\"Northing\",NORTH]"; + internal const string SpheroidGRS1980 = "SPHEROID[\"GRS 1980\",6378137,298.257222101]"; + internal const string SpheroidGRS1967Modified = "SPHEROID[\"GRS 1967 Modified\",6378160,298.25]"; + internal const string PrimeMeridian = "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]]"; + internal const string UnitDegree = "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]"; + internal const string UnitMeter = "UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]]"; + internal const string ProjectionTM = "PROJECTION[\"Transverse_Mercator\"]"; + internal const string ProjectionLCC = "PROJECTION[\"Lambert_Conformal_Conic_2SP\"]"; + internal const string AxisEast = "AXIS[\"Easting\",EAST]"; + internal const string AxisNorth = "AXIS[\"Northing\",NORTH]"; - private const string GeoGcsETRS89 + internal const string GeoGcsETRS89 = "GEOGCS[\"ETRS89\"," + "DATUM[\"European_Terrestrial_Reference_System_1989\"," - + SpheroidGRS1980 + "," - + "AUTHORITY[\"EPSG\",\"6258\"]]," + + SpheroidGRS1980 + "]," + PrimeMeridian + "," + UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4258\"]]"; - private const string GeoGcsGGRS87 + internal const string GeoGcsGGRS87 = "GEOGCS[\"GGRS87\"," + "DATUM[\"Greek_Geodetic_Reference_System_1987\"," - + SpheroidGRS1980 + "," - + "TOWGS84[-199.87,74.79,246.62,0,0,0,0]]," + + SpheroidGRS1980 + ",TOWGS84[-199.87,74.79,246.62,0,0,0,0]]," + PrimeMeridian + "," + UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4121\"]]"; - private const string GeoGcsETRF2000PL + internal const string GeoGcsETRF2000PL = "GEOGCS[\"ETRF2000-PL\"," + "DATUM[\"ETRF2000_Poland\"," + SpheroidGRS1980 + "]," @@ -40,20 +38,18 @@ namespace MapControl.Projections + UnitDegree + "," + "AUTHORITY[\"EPSG\",\"9702\"]]"; - private const string GeoGcsSAD69A + internal const string GeoGcsSAD69A = "GEOGCS[\"SAD69\"," + "DATUM[\"South_American_Datum_1969\"," - + SpheroidGRS1967Modified + "," - + "TOWGS84[-57,1,-41,0,0,0,0]]," + + SpheroidGRS1967Modified + ",TOWGS84[-57,1,-41,0,0,0,0]]," + PrimeMeridian + "," + UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4618\"]]"; - private const string GeoGcsSAD69B + internal const string GeoGcsSAD69B = "GEOGCS[\"SAD69\"," + "DATUM[\"South_American_Datum_1969\"," - + SpheroidGRS1967Modified + "," - + "TOWGS84[-67.35,3.88,-38.22,0,0,0,0]]," + + SpheroidGRS1967Modified + ",TOWGS84[-67.35,3.88,-38.22,0,0,0,0]]," + PrimeMeridian + "," + UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4618\"]]"; diff --git a/MapProjections/Shared/Nad27UtmProjection.cs b/MapProjections/Shared/Nad27UtmProjection.cs index 891474ea..47e60308 100644 --- a/MapProjections/Shared/Nad27UtmProjection.cs +++ b/MapProjections/Shared/Nad27UtmProjection.cs @@ -27,18 +27,18 @@ namespace MapControl.Projections + "GEOGCS[\"NAD27\"," + "DATUM[\"North_American_Datum_1927\"," + "SPHEROID[\"Clarke 1866\",6378206.4,294.978698213898]]," - + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]]," - + "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]," + + GeoApiProjectionFactory.PrimeMeridian + "," + + GeoApiProjectionFactory.UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4267\"]]," - + "PROJECTION[\"Transverse_Mercator\"]," + + GeoApiProjectionFactory.ProjectionTM + "," + "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]," + + GeoApiProjectionFactory.UnitMeter + "," + + GeoApiProjectionFactory.AxisEast + "," + + GeoApiProjectionFactory.AxisNorth + "," + $"AUTHORITY[\"EPSG\",\"267{zone:00}\"]]"; } } diff --git a/MapProjections/Shared/Nad83UtmProjection.cs b/MapProjections/Shared/Nad83UtmProjection.cs index c3ddaa34..47ea5260 100644 --- a/MapProjections/Shared/Nad83UtmProjection.cs +++ b/MapProjections/Shared/Nad83UtmProjection.cs @@ -27,18 +27,18 @@ namespace MapControl.Projections + "GEOGCS[\"NAD83\"," + "DATUM[\"North_American_Datum_1983\"," + "SPHEROID[\"GRS 1980\",6378137,298.257222101]]," - + "PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]]," - + "UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]]," + + GeoApiProjectionFactory.PrimeMeridian + "," + + GeoApiProjectionFactory.UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4269\"]]," - + "PROJECTION[\"Transverse_Mercator\"]," + + GeoApiProjectionFactory.ProjectionTM + "," + "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]," + + GeoApiProjectionFactory.UnitMeter + "," + + GeoApiProjectionFactory.AxisEast + "," + + GeoApiProjectionFactory.AxisNorth + "," + $"AUTHORITY[\"EPSG\",\"269{zone:00}\"]]"; } } diff --git a/MapProjections/Shared/WorldMercatorProjection.cs b/MapProjections/Shared/WorldMercatorProjection.cs index 874f69b0..ebc06711 100644 --- a/MapProjections/Shared/WorldMercatorProjection.cs +++ b/MapProjections/Shared/WorldMercatorProjection.cs @@ -18,14 +18,9 @@ namespace MapControl.Projections CoordinateSystemWkt = "PROJCS[\"WGS 84 / World Mercator\"," + "GEOGCS[\"WGS 84\"," - + "DATUM[\"WGS_1984\"," - + "SPHEROID[\"WGS 84\",6378137,298.257223563," - + "AUTHORITY[\"EPSG\",\"7030\"]]," - + "AUTHORITY[\"EPSG\",\"6326\"]]," - + "PRIMEM[\"Greenwich\",0," - + "AUTHORITY[\"EPSG\",\"8901\"]]," - + "UNIT[\"degree\",0.0174532925199433," - + "AUTHORITY[\"EPSG\",\"9122\"]]," + + "DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563]]," + + GeoApiProjectionFactory.PrimeMeridian + "," + + GeoApiProjectionFactory.UnitDegree + "," + "AUTHORITY[\"EPSG\",\"4326\"]]," + "PROJECTION[\"Mercator_1SP\"]," + "PARAMETER[\"latitude_of_origin\",0]," @@ -33,10 +28,9 @@ namespace MapControl.Projections + "PARAMETER[\"scale_factor\",1]," + "PARAMETER[\"false_easting\",0]," + "PARAMETER[\"false_northing\",0]," - + "UNIT[\"metre\",1," - + "AUTHORITY[\"EPSG\",\"9001\"]]," - + "AXIS[\"Easting\",EAST]," - + "AXIS[\"Northing\",NORTH]," + + GeoApiProjectionFactory.UnitMeter + "," + + GeoApiProjectionFactory.AxisEast + "," + + GeoApiProjectionFactory.AxisNorth + "," + "AUTHORITY[\"EPSG\",\"3395\"]]"; }