我正在尝试将地理坐标(度)转换为 UTM 坐标(米)并不断收到“检测到非有限变换”的错误消息。你知道我该如何解决这个问题吗?这是我使用的代码:
> GPS.Points <- Gomer.Data[, c('Longitude', 'Latitude')]
> head(GPS.Points)
Longitude Latitude
1 23.85474 -19.52211
2 23.85531 -19.52243
3 23.85534 -19.52257
4 23.85580 -19.52346
5 23.85551 -19.52380
6 23.85513 -19.52360
> GPS.Points.Spatial.Data <- SpatialPoints(GPS.Points,
proj4string=CRS("+proj=longlat +ellps=WGS84"))
> GPS.Points.Spatial.Data[1]
SpatialPoints:
Longitude Latitude
[1,] 23.85474 -19.52211
Coordinate Reference System (CRS) arguments: +proj=longlat +ellps=WGS84
> class(GPS.Points.Spatial.Data)
[1] "SpatialPoints"
attr(,"package")
[1] "sp"
> GPS.Points.UTM.Spatial.Data <- spTransform(GPS.Points.Spatial.Data,
CRS("+proj=utm +south +zone=34 +ellps=WGS84"))
non finite transformation detected:
Longitude Latitude
Error in spTransform(GPS.Points.Spatial.Data, CRS("+proj=utm +south +zone=34 +ellps=WGS84")) :
failure in points
In addition: Warning message:
In spTransform(GPS.Points.Spatial.Data, CRS("+proj=utm +south +zone=34 +ellps=WGS84")) :
3 projected point(s) not finite