cs0815
cs0815

Reputation: 17388

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!

Upvotes: 7

Views: 5648

Answers (1)

yosukesabai
yosukesabai

Reputation: 6244

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

Upvotes: 11

Related Questions