7

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!

Triad sou.
  • 2,969
  • 3
  • 23
  • 27
cs0815
  • 16,751
  • 45
  • 136
  • 299

1 Answers1

11

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

yosukesabai
  • 6,184
  • 4
  • 30
  • 42
  • 1
    Are you saying that (-107,26) has the same UTM coordinates as (107,26)? – cs0815 Nov 02 '11 at 12:57
  • 1
    what i meant to say is (lon,lat) = (-107,26) means, by convention, 107 degree **West**, 26 degree North. UTM zone 51 lies on top of somewhere near philippines. So I assumed that you meant your coordinate to be eastern hemisphere. You have to pick right UTM zone for your coordinate, if it is too off, you cannot project like in this case. – yosukesabai Nov 02 '11 at 13:00
  • `xy <- cbind(c(107), c(26))` do this way. – yosukesabai Nov 02 '11 at 13:05
  • My question is related to this: http://stackoverflow.com/questions/7927863/location-data-format-for-adehabitat-package. So do I have to determin the right zone for each longitude. I understand there are 60 zones. Is there no easier way to transfer my lats/longs to UTM? Thanks. – cs0815 Nov 02 '11 at 13:08
  • Does your data cover entire globe? If so UTM is not good, as it is meant for smaller area, like one country. You better use some other projections, such as ... I need to look one up. – yosukesabai Nov 02 '11 at 13:11
  • Yes the data (potentially) covers the whole globe. Someone suggested UTM here: http://stackoverflow.com/questions/7927863/location-data-format-for-adehabitat-package so not sure what to do as I am no GIS specialist – cs0815 Nov 02 '11 at 13:14
  • 1
    I looked up mention of Mollweide or Aitoff's projection as map projection that covers entire globe with **equal-area**. By unfolding spherical earth to rectangle, you cannot avoid skewing the geometry. you keep some of property (e.g., angle, size), and according to this guy you better keep area [http://www.wiley.com/bw/submit.asp?ref=1466-822X&site=1](http://www.wiley.com/bw/submit.asp?ref=1466-822X&site=1). If you have textbook of your favorite, you look carefully the caption of maps in it and see if there is mention of map projections. – yosukesabai Nov 02 '11 at 13:20
  • alternatively you can use UTM, but by sections. i.e., analyze australia philippines etc, then India, then Iran etc, then... and come up with composite pitcure somehow. I am not ecology expert and what makes most sense to you. i look at [molwide projections picture](http://en.wikipedia.org/wiki/Mollweide_projection), and it is fairy skewed at high latitude. I am not sure if that causes trouble with ENFA, cuz, direction that is right angle arent on right angle any more on that projection. Does ENFA manual has recommendation for projection when you cover large area like your case? – yosukesabai Nov 02 '11 at 13:34