mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-01-30 20:34:38 +01:00
Updated map projections
This commit is contained in:
parent
9c02647c59
commit
98f057ca0c
|
|
@ -9,12 +9,12 @@ using Avalonia;
|
|||
namespace MapControl
|
||||
{
|
||||
/// <summary>
|
||||
/// Spherical Azimuthal Equidistant Projection - No standard CRS identifier.
|
||||
/// Spherical Azimuthal Equidistant Projection - AUTO2:97003.
|
||||
/// See "Map Projections - A Working Manual" (https://pubs.usgs.gov/publication/pp1395), p.195-197.
|
||||
/// </summary>
|
||||
public class AzimuthalEquidistantProjection : AzimuthalProjection
|
||||
{
|
||||
public const string DefaultCrsId = "AUTO2:97003"; // proprietary CRS identifier
|
||||
public const string DefaultCrsId = "AUTO2:97003"; // GeoServer non-standard CRS identifier
|
||||
|
||||
public AzimuthalEquidistantProjection() // parameterless constructor for XAML
|
||||
: this(DefaultCrsId)
|
||||
|
|
|
|||
|
|
@ -49,9 +49,7 @@ namespace MapControl.Projections
|
|||
var name = field.Projection?.Name ??
|
||||
throw new ArgumentException("CoordinateSystem.Projection must not be null.", nameof(value));
|
||||
|
||||
IsNormalCylindrical = name.StartsWith("Mercator") ||
|
||||
name.StartsWith("Equirectangular") ||
|
||||
name.Contains("Pseudo-Mercator");
|
||||
IsNormalCylindrical = name.StartsWith("Mercator") || name.Contains("Pseudo-Mercator");
|
||||
|
||||
var transformFactory = new CoordinateTransformationFactory();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
#if WPF
|
||||
using System.Windows.Media;
|
||||
#endif
|
||||
|
|
@ -38,11 +37,8 @@ namespace MapControl.Projections
|
|||
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;
|
||||
return p.RelativeScale(p.CosC, 1d); // p.149 (20-5), k == 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace MapControl.Projections
|
|||
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);
|
||||
return p.RelativeScale(k, k);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue