在阿尔伯斯投影地图上将纬度/经度转换为X/Y坐标

Convert Lat/Longs to X/Y Coordinates on Albers projection map

本文关键字:转换 经度 坐标 纬度 阿尔伯 投影 地图      更新时间:2023-09-26

我有一张阿尔伯斯投影的地图,我有某个位置的Lat和Long,我需要在这张图像上画一个点。我知道这张地图是用阿尔伯斯投影法在52和64以及WGS84上使用标准平行线绘制的。我试着用Javascript实现这个公式,但结果似乎是错误的。我不知道该怎么办。我发现了一些类似的问题,但他们没有给我答案。

// lat and long of left top corner
f0 = 66 * (Math.PI/180); 
a0 = 36 * (Math.PI/180);
// lat and long of my point
f = 55 * (Math.PI/180);
a = 37 * (Math.PI/180); 
// Standart parallers
f1 = 52 * (Math.PI/180);
f2 = 64 * (Math.PI/180);
n = 1/2 * (Math.sin(f1)+Math.sin(f2));
c = Math.pow(Math.cos(f1),2) + 2*n*Math.sin(f1);
t = n*(a*(180/Math.PI) - a0*(180/Math.PI))* (Math.PI/180);
p0 = 1/n * Math.sqrt(c-2*n*Math.sin(f0));
p=1/n*Math.sqrt(c-2*n*Math.sin(f));
x=p*Math.sin(t);
y=p0-p*Math.cos(t);

谢谢。

问题已解决好的,我还需要为我的地图计算子午线。此代码运行良好。

function albers(lat, lng) {
    var lat0 = 66 * (Math.PI/180),   // Latitude_Of_Origin
        lng0 = 105 * (Math.PI/180),  // Central_Meridian
        phi1 = 52 * (Math.PI/180),   // Standard_Parallel_1
        phi2 = 64 * (Math.PI/180),  // Standard_Parallel_2

        n = 0.5 * (Math.sin(phi1) + Math.sin(phi2)),
        c = Math.cos(phi1),
        C = c*c + 2*n*Math.sin(phi1),
        p0 = Math.sqrt(C - 2*n*Math.sin(lat0)) / n,
        theta = n * (lng * Math.PI/180 - lng0),
        p = Math.sqrt(C - 2*n*Math.sin(lat* Math.PI/180)) / n,
        x = p * Math.sin(theta),
        y = p0 - p * Math.cos(theta)
        return [x,y]
}

所有学分都转到https://gist.github.com/RandomEtc/476238