[R-sig-Geo] ?==?utf-8?q? Proj4 - latitude or longitude exceeded limits

Gilles Benjamin Leduc gbl1 at hi.is
Tue Jan 17 20:32:49 CET 2017


 
 Hi, 

So, if I understand you need to manage GPS coordinate and projected data. I had few issues the first time I faced such data. Are you sure that your projected data use an UTM system or a specific system? 
I think that "loc <- dat[,c("Longitude","Latitude")" is GPS system. Is the other a shapefile? 

What I did: 

I had such a dataset: 

 pointsGPS
           [,1]     [,2]
 [1,] -18.30896 63.45118
 [2,] -20.35166 63.60880
 [3,] -17.86225 63.64588
 [4,] -19.05010 63.40444
 [5,] -17.29260 63.84592
 [6,] -19.41010 63.46001
 [7,] -20.61661 63.71676
 [8,] -20.26965 63.44854
 [9,] -20.27939 63.40519
[10,] -21.37864 63.86440
[11,] -20.59592 63.29990
[12,] -20.59403 63.30314
[13,] -20.59867 63.29820
[14,] -20.60931 63.29921
[15,] -20.60914 63.30391
[16,] -20.59884 63.30877
[17,] -22.02663 64.15252

I made of them a compatible class:

SpatialPoints(pointsGPS)-> pointsGPS  

Then I added the CRS:

 proj4string(pointsGPS) <- CRS(" +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0 ")  

Then I projected them: 

PointsISN <- spTransform(pointsGPS, CRS("+proj=lcc +lat_1=64.25 +lat_2=65.75 +lat_0=65 +lon_0=-19 +x_0=500000 +y_0=500000 +ellps=GRS80 +units=m +no_defs ")) 

I had issues to find the CRS to project in, there was a command to obtain the CRS of the shapefile, I think it was  proj4string() but i'm not that sure, I haven't done it for a while.

Good luck, hoping it helps.

Benjamin 


 
Le Mardi 17 Janvier 2017 16:44 GMT, <aurelie.tschopp at vetsuisse.unibe.ch> a écrit: 
 
> Dear all,
> 
> I am analysing GPS Data from Chad. I need to first project the latitude and longitudes. I use the package Proj4, the function project for this.  I have 2 devices and with the data of the 1st device, the projection worked perfectly. But with the data from the other device, I got this error message: "Error in project(loc, "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs") : latitude or longitude exceeded limits"
> 
> I found that Chad was UTM 33P (Wikipedia UTM: https://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system ), but some people could use the notification 33N: 33 for the zone and N for the North hemisphere. 
> My code is: loc <- dat[,c("Longitude","Latitude")
> loc_Zone33 <- project(loc, "+proj=utm +zone=33 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
> 
> Does anybody know where my problem could be?
> Thank you
> Aurélie
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list