简体   繁体   中英

rgdal package lat/long -> UTM

Can someone see what's wrong with this:

library(rgdal)

# Make a two-column matrix, col1 = long, col2 = lat
xy <- cbind(c(-107), c(26))
# Convert it to UTM coordinates (in units of meters)
project(xy, "+proj=utm +zone=51 ellps=WGS84")

I understand that Latitude greater than 84 and smaller than 80 are invalid but why do I get:

In project(xy, "+proj=utm +zone=51 ellps=WGS84") :
  1 projected point(s) not finite

Thanks!

use positive number for longitude (107, instead of -107). negative is for western hemisphere

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM