GMap.NET.Core/GMap.NET.Projections/MapyCZProjection.cs
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace GMap.NET.Projections
{
using System;
/// <summary>
/// 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.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]
/// PROJCS["Mapy.cz",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",15],PARAMETER["scale_factor",0.9996],PARAMETER["false_easting",134400000],PARAMETER["false_northing",-41600000],UNIT["1/32meter",0.03125]]
/// </summary>
public class MapyCZProjection : PureProjection
{
public static readonly MapyCZProjection Instance = new MapyCZProjection();
static readonly double MinLatitude = 26;
static readonly double MaxLatitude = 76;
static readonly double MinLongitude = -26;
static readonly double MaxLongitude = 38;
#region -- Common --
static int getLCM(int zone)
{
if((zone < 1) || (zone > 60))
{
throw new Exception("MapyCZProjection: UTM Zone number is not between 1 and 60.");
}
else
{
return ((zone * 6) - 183);
}
}
static double roundoff(double xx, double yy)
{
var x = xx;
var y = yy;
x = Math.Round(x * Math.Pow(10, y)) / Math.Pow(10, y);
return x;
}
static readonly double UTMSIZE = 2;
static readonly double UNITS = 1;
#endregion
#region -- WGSToMapyCZ --
public long[] WGSToPP(double la, double lo)
{
var utmEE = wgsToUTM(DegreesToRadians(la), DegreesToRadians(lo), 33);
var pp = utmEEToPP(utmEE[0], utmEE[1]);
return pp;
}
static long[] utmEEToPP(double east, double north)
{
var x = (Math.Round(east) - (-3700000.0)) * Math.Pow(2, 5);
var y = (Math.Round(north) - (1300000.0)) * Math.Pow(2, 5);
return new long[] { (long)x, (long)y };
}
后面还有 191 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
