Comments on map projections

This commit is contained in:
Clemens 2022-02-23 23:19:32 +01:00
parent f6b4830f24
commit 6a14d740e8
9 changed files with 27 additions and 16 deletions

View file

@ -9,6 +9,11 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Auto-Equirectangular Projection - AUTO2:42004.
/// Equidistant cylindrical projection with standard parallel and central meridian set by the Center property.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.90-91.
/// </summary>
public class AutoEquirectangularProjection : MapProjection
{
public const string DefaultCrsId = "AUTO2:42004";
@ -16,24 +21,21 @@ namespace MapControl
public AutoEquirectangularProjection()
{
CrsId = DefaultCrsId;
IsNormalCylindrical = true;
}
public override Point LocationToMap(Location location)
{
var xScale = Wgs84MetersPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d);
return new Point(
xScale * (location.Longitude - Center.Longitude),
Wgs84MetersPerDegree * (location.Longitude - Center.Longitude) * Math.Cos(Center.Latitude * Math.PI / 180d),
Wgs84MetersPerDegree * location.Latitude);
}
public override Location MapToLocation(Point point)
{
var xScale = Wgs84MetersPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d);
return new Location(
point.Y / Wgs84MetersPerDegree,
point.X / xScale + Center.Longitude);
point.X / (Wgs84MetersPerDegree * Math.Cos(Center.Latitude * Math.PI / 180d)) + Center.Longitude);
}
}
}

View file

@ -10,12 +10,11 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Spherical Azimuthal Equidistant Projection.
/// Spherical Azimuthal Equidistant Projection - No standard CRS ID.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.195-197.
/// </summary>
public class AzimuthalEquidistantProjection : AzimuthalProjection
{
// No standard CRS ID
public override Point LocationToMap(Location location)
{
if (location.Equals(Center))

View file

@ -13,8 +13,9 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Equirectangular Projection.
/// Longitude and Latitude values are transformed linearly to X and Y values in meters.
/// Equirectangular Projection - EPSG:4326.
/// Equidistant cylindrical projection with zero standard parallel and central meridian.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.90-91.
/// </summary>
public class EquirectangularProjection : MapProjection
{

View file

@ -10,7 +10,8 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Spherical Gnomonic Projection.
/// Spherical Gnomonic Projection - AUTO2:97001.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.165-167.
/// </summary>
public class GnomonicProjection : AzimuthalProjection
{

View file

@ -10,7 +10,8 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Spherical Orthographic Projection.
/// Spherical Orthographic Projection - AUTO2:42003.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.148-150.
/// </summary>
public class OrthographicProjection : AzimuthalProjection
{

View file

@ -10,7 +10,8 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Spherical Stereographic Projection.
/// Spherical Stereographic Projection - AUTO2:97002.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.157-160.
/// </summary>
public class StereographicProjection : AzimuthalProjection
{

View file

@ -10,7 +10,7 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Spherical Mercator Projection, EPSG:3857.
/// Spherical Mercator Projection - EPSG:3857.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.41-44.
/// </summary>
public class WebMercatorProjection : MapProjection

View file

@ -10,7 +10,7 @@ using System.Windows;
namespace MapControl
{
/// <summary>
/// Elliptical Mercator Projection, EPSG:3395.
/// Elliptical Mercator Projection - EPSG:3395.
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/pp/1395/report.pdf), p.44-45.
/// </summary>
public class WorldMercatorProjection : MapProjection

View file

@ -112,6 +112,9 @@ namespace MapControl.Projections
}
}
/// <summary>
/// Elliptical North Polar Stereographic Projection - EPSG:32661.
/// </summary>
public class UpsNorthProjection : PolarStereographicProjection
{
public const string DefaultCrsId = "EPSG:32661";
@ -122,6 +125,9 @@ namespace MapControl.Projections
}
}
/// <summary>
/// Elliptical South Polar Stereographic Projection - EPSG:32761.
/// </summary>
public class UpsSouthProjection : PolarStereographicProjection
{
public const string DefaultCrsId = "EPSG:32761";