4

我正在尝试将坐标从 WGS84 重新投影到 MGA Zone 53,这是基于 GDA94 基准的 UTM 投影。我的结果是无穷大,这绝对是不正确的。我正在使用 R 的proj4包,如下所示:

> library(proj4)
> df <- data.frame("x" = c(131.1, 131.102, 131.1106, 133.34), "y" = c(-13.23, -13.243, -13.22, -22.66))
> df
         x       y
1 131.1000 -13.230
2 131.1020 -13.243
3 131.1106 -13.220
4 133.3400 -22.660
> ptransform(data = df, src.proj = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs", dst.proj = "+proj=utm +zone=53 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
$x
[1] Inf Inf Inf Inf

$y
[1] Inf Inf Inf Inf

$z
[1] 0 0 0 0

> 

这里出了什么问题?

4

2 回答 2

4

问题是 ptransform 需要弧度,而不是度数。proj4:::project 函数默认为度数。如果转换为弧度,结果与 ptransform 相同。

于 2010-10-21T09:49:12.430 回答
3

proj4包是从哪里获得的?

如果可以安装,请尝试 rgdal:

df <- data.frame("x" = c(131.1, 131.102, 131.1106, 133.34), "y" = c(-13.23, -13.243, -13.22, -22.66))

图书馆(rgdal)

## 项目需要一个矩阵,假设源是 longlat/WGS84

项目(as.matrix(df),“+proj=utm +zone=53 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs”)

     [,1]    [,2]

[1,] 77177.18 8534132

[2,] 77416.79 8532695

[3、]78310.75 8535258

[4,] 329440.68 7493165

于 2010-10-21T07:15:04.783 回答