I would check the data you are trying to convert. I could not access the data that you have in your example, so I just used the first three coordinate points that you provided to try to reproduce the error and did not get the error. I also checked if the error could be caused by the fact that the indicated UTM zone does not include all points obtained by changing the zone number and the north / south parameter, and it still worked. I would perhaps create a loop that iterates through the data you want to convert to pieces to see where the problem is ...
library(rgdal) GPS.Points=data.frame(Longitude=c(23.85474, 23.85531, 23.85534)) GPS.Points=cbind(GPS.Points,Latitude=c(-19.52211, -19.52243, -19.52257)) GPS.Points.Spatial.Data <- SpatialPoints(GPS.Points, proj4string=CRS("+proj=longlat +ellps=WGS84")) GPS.Points.Spatial.Data[1] class(GPS.Points.Spatial.Data) GPS.Points.UTM.Spatial.Data <- spTransform(GPS.Points.Spatial.Data, CRS("+proj=utm +south +zone=34 +ellps=WGS84"))
As you asked, here is the code to iterate over pieces of data. If you get an error message, you at least know where in your data a problem arose from:
library(rgdal) GPS.Points=data.frame(Longitude=c(23.85474, 23.85531, 23.85534, 23.85474, 23.85531, 23.85534, 23.85474, 23.85531, 23.85534)) GPS.Points=cbind(GPS.Points,Latitude=c(-19.52211, -19.52243, -19.52257, -19.52211, -19.52243, -19.52257, -19.52211, -19.52243, -19.52257)) n_chunks=3
source share