我提前为我的初学者问题道歉,但 R 空间分析对我来说是全新的。
我正在尝试将整个数据集(纬度、经度)转换为厄瓜多尔的 UTM(区域 = 17)。我下面的代码仅转换第一个纬度/经度坐标。任何建议将不胜感激!
require(proj4)
require(rgdal)
require(sp)
require(proj4)
## Load dataset, total h7_x length = 327463
h7 <- read.csv('h7.csv', header=T)
h7 <- data.frame(x=h7$h7_x, y=h7$h7_y)
## Convert Lat/Long to UTM
proj4string <- "+proj=utm +zone=17 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
## Transformed data
pj.h7 <- project(h7, proj4string, inverse=TRUE)
latlon.h7 <- data.frame(lat=pj.h7$y, lon=pj.h7$x)