Hello List,
Thanks for any help in advance! I am new to spatial analysis in R and in
general and so apologize if I am missing something simple.
I have a set of lat/long coordinates that span North America and I would
like to convert them to utm's (North_America_Lambert_Conformal_Conic). I
have attempted to do this using the mapproject command in the mapproj
library but I keep getting strangely low utm's. My attempts are
replicated
below
My map attributes:
Object of class SpatialPolygonsDataFrame
Coordinates:
min max
r1 -4907279 4031980
r2 -3453182 5806061
Is projected: TRUE
proj4string :
[+proj=lcc +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0
+ellps=GRS80 +datum=NAD83 +units=m +no_defs +towgs84=0,0,0]
Data attributes:
North America
1
sample lat/longs:
x <- c(39.953438, 45.271987, 43.179207, 49.8703, 41.864192, 47.0049,
54.727594, 48.719167, 41.338611, 49, 51.363957, 45.187723, 50.203889,
50.094167, 27.479949, 51.384852, 58.943633, 52.4, 55.87)
y <- c(-119.511746, -97.339382, -112.280316, -88.939133, -121.144867,
-99.435282, -107.509804, -88.458611, -112.858611, -94.666667, -105.239754,
-96.130199, -88.758333, -88.337222, -97.314835, -96.550598, -113.24913,
-123.05, -115.3275)
coords<-as.data.frame(cbind(x,y))
My code and results:
x <- c(39.953438, 45.271987, 43.179207, 49.8703, 41.864192, 47.0049,
54.727594, 48.719167, 41.338611, 49, 51.363957, 45.187723, 50.203889,
50.094167, 27.479949, 51.384852, 58.943633, 52.4, 55.87)
y <- c(-119.511746, -97.339382, -112.280316, -88.939133, -121.144867,
-99.435282, -107.509804, -88.458611, -112.858611, -94.666667, -105.239754,
-96.130199, -88.758333, -88.337222, -97.314835, -96.550598, -113.24913,
-123.05, -115.3275)
coords<-as.data.frame(cbind(x,y))
mapproject((coords), projection = "lambert", param = c(20, 60),
orientation = c(40,-96,0))
$x
[1] -0.34331799 -0.11436538 -0.27206521 0.01792251 -0.33693782
-0.13471935
-0.16832946 0.02711496 -0.28870789 -0.07032821 -0.17079579
[12] -0.09824454 0.02089270 0.02835444 -0.15848767 -0.08855674
-0.17102350
-0.25815791 -0.20128084
$y
[1] -1.401480 -1.797972 -1.514287 -1.986024 -1.369876 -1.750728 -1.574392
-1.997333 -1.509375 -1.851279 -1.624597 -1.823937 -1.990606 -2.001015
[15] -1.834957 -1.806036 -1.463011 -1.315917 -1.432837
$range
[1] -0.34331799 0.02835444 -2.00101509 -1.31591678
$error
[1] 0
[[alternative HTML version deleted]]