mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Comments on map projections
This commit is contained in:
parent
f6b4830f24
commit
6a14d740e8
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue