如何在R特例非洲中将UTM坐标转换为经纬度

问题描述:

您好,我在这里尝试过此代码

Hello I tried this code from here How to convert UTM coordinates to lat and long in R like this

   SP <- SpatialPoints(cbind(457500, 9347500))
   sputm <- SpatialPoints(SP, proj4string=CRS("+proj=utm +zone=35M +datum=WGS84")) 
   spgeo <- spTransform(sputm, CRS("+proj=longlat +datum=WGS84"))

有了这个结果

   spgeo
   #SpatialPoints:
   #     coords.x1 coords.x2
   #[1,]  23.25527  84.16145
   #Coordinate Reference System (CRS) arguments: +proj=longlat +datum=WGS84 +no_defs 

但这是错误的.结果应为lat = -5.90303 long = 26.616044

But this is wrong. the result should be lat=-5.90303 long=26.616044

此代码出了什么问题,导致结果如此不同.谢谢您的帮助.

what is wrong in this code that the result is so different Thank you for any help.

您必须使用 + zone = 35 + south 而不是 + zone = 35M .>

You have to use +zone=35 +south instead of +zone=35M.

library(rgdal)
SP <- SpatialPoints(cbind(457500, 9347500))
sputm <- SpatialPoints(SP, proj4string=CRS("+proj=utm +zone=35 +south +datum=WGS84"))
spTransform(sputm, CRS("+proj=longlat +datum=WGS84"))
#SpatialPoints:
#     coords.x1 coords.x2
#[1,]  26.61604  -5.90303
#Coordinate Reference System (CRS) arguments: +proj=longlat +datum=WGS84
#+ellps=WGS84 +towgs84=0,0,0