Re: [R] LAT/LON to UTM in R

2014-11-19 Thread Zilefac Elvis
Many thanks Jean for the clarification.Zilefac. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html an

Re: [R] LAT/LON to UTM in R

2014-11-19 Thread Adams, Jean
Zilefac, Those do look different. I called that data frame "arc", and ran this code to look at all three versions of the coordinates. par(mfrow=c(2, 2)) map("world", type="n", xlim=range(xy$X), ylim=range(xy$Y), mar=c(1, 1, 2, 1)) points(xy[, c("X", "Y")]) mtext("xy lat long", side=3, font=2, li

Re: [R] LAT/LON to UTM in R

2014-11-19 Thread MacQueen, Don
By the way, this question is more appropriate for R-sig-geo. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 11/18/14, 8:20 AM, "Zilefac Elvis" wrote: >Hi, >I am trying to convert lat/lon to UTM but my results are extremely

Re: [R] LAT/LON to UTM in R

2014-11-19 Thread Zilefac Elvis
Hi Adam,I was not sure if my solution was correct.This is what I got using ArcGIS to convert the same coordinates: +proj=lcc +lat_1=49 +lat_2=77 +lat_0=49 +lon_0=-95 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0" structure(list(Long = c(662843L, 303344L, 634922L, 63417

Re: [R] LAT/LON to UTM in R

2014-11-19 Thread Adams, Jean
Zilefac, When I try library(rgdal) utm <- project(as.matrix(xy[,c("X","Y")]), "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs") plot(utm) the points look fine. Similar to map("world", xlim=range(xy$X), ylim=range(xy$Y)) points(xy[, c("X", "Y")]) What's wrong with them? Jean On Wed, Nov 19

Re: [R] LAT/LON to UTM in R

2014-11-19 Thread Zilefac Elvis
Hi Admas,Sorry I missed out the reproducible example.Here it is: dput(xy)structure(list(ID = 1:120, X = c(-102.6, -101.9, -97.1, -97, -95.7, -99.1, -100.1, -97.2, -97, -99.3, -96, -95.2, -98.8, -98.1, -99.6, -97.8, -96.1, -98.3, -95.6, -96.8, -101.2, -101.1, -97.2, -111.1, -111.2, -116, -117.6,

Re: [R] LAT/LON to UTM in R

2014-11-19 Thread Adams, Jean
Zilefac, I tried to run your "reproducible" code, but you didn't provide an object "xy". Jean On Tue, Nov 18, 2014 at 10:20 AM, Zilefac Elvis wrote: > Hi, > I am trying to convert lat/lon to UTM but my results are extremely flawed. > Is it because of wrong UTM zone or my lon points are negativ

[R] LAT/LON to UTM in R

2014-11-18 Thread Zilefac Elvis
Hi, I am trying to convert lat/lon to UTM but my results are extremely flawed. Is it because of wrong UTM zone or my lon points are negative? I read a shapefile from ESRI using: library(rgdal) stations <- readOGR(".","stations") print(proj4string(stations)) ## +proj=longlat +ellps=WGS84 +datum=WG