mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Rotated relative scale in MapProjections
This commit is contained in:
parent
25d4e13c16
commit
3fbfb0d5c1
8 changed files with 85 additions and 41 deletions
|
|
@ -1,7 +1,15 @@
|
|||
using System.Globalization;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
#if WPF
|
||||
using System.Windows.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// Spherical Orthographic Projection - AUTO2:42003.
|
||||
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/publication/pp1395), p.148-150.
|
||||
/// </summary>
|
||||
public class Wgs84OrthographicProjection : ProjNetMapProjection
|
||||
{
|
||||
public Wgs84OrthographicProjection()
|
||||
|
|
@ -25,5 +33,15 @@ namespace MapControl.Projections
|
|||
CoordinateSystemWkt = string.Format(
|
||||
CultureInfo.InvariantCulture, wktFormat, Center.Latitude, Center.Longitude);
|
||||
}
|
||||
|
||||
public override Matrix RelativeScale(double latitude, double longitude)
|
||||
{
|
||||
var p = new AzimuthalProjection.ProjectedPoint(Center.Latitude, Center.Longitude, latitude, longitude);
|
||||
var h = p.CosC; // p.149 (20-5)
|
||||
|
||||
var scale = new Matrix(h, 0d, 0d, 1d, 0d, 0d);
|
||||
scale.Rotate(-Math.Atan2(p.Y, p.X) * 180d / Math.PI);
|
||||
return scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,14 @@
|
|||
using System.Globalization;
|
||||
#if WPF
|
||||
using System.Windows.Media;
|
||||
#endif
|
||||
|
||||
namespace MapControl.Projections
|
||||
{
|
||||
/// <summary>
|
||||
/// Spherical Stereographic Projection - AUTO2:97002.
|
||||
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/publication/pp1395), p.157-160.
|
||||
/// </summary>
|
||||
public class Wgs84StereographicProjection : ProjNetMapProjection
|
||||
{
|
||||
public Wgs84StereographicProjection()
|
||||
|
|
@ -25,5 +32,13 @@ namespace MapControl.Projections
|
|||
CoordinateSystemWkt = string.Format(
|
||||
CultureInfo.InvariantCulture, wktFormat, Center.Latitude, Center.Longitude);
|
||||
}
|
||||
|
||||
public override Matrix RelativeScale(double latitude, double longitude)
|
||||
{
|
||||
var p = new AzimuthalProjection.ProjectedPoint(Center.Latitude, Center.Longitude, latitude, longitude);
|
||||
var k = 2d / (1d + p.CosC); // p.157 (21-4), k0 == 1
|
||||
|
||||
return new Matrix(k, 0d, 0d, k, 0d, 0d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue