# converting lat long points to UTM

5 messages
Open this post in threaded view
|
Report Content as Inappropriate

## converting lat long points to UTM

 Dear Colleagues, Good day! I have a data points collected using GPS..It was on latitude and longitude coordinate system ..I wonder if there's any function in R where I could convert those GPS data points to UTM (e.g. UTM Zone 51N)?  Thanks in advance Arnold         [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|
Report Content as Inappropriate

## Re: converting lat long points to UTM

 The rgdal package has the project() function for direct conversion to/from longlat (WGS84) - via the PROJ.4 library, via GDAL - all embedded in the package. library(rgdal) xy <- cbind(c(118, 119), c(10, 50)) project(xy, "+proj=utm +zone=51 ellps=WGS84")           [,1]    [,2] [1,] -48636.65 1109577 [2,] 213372.05 5546301 Be aware that that is a very minimal "PROJ.4" string (metres is assumed), and that "+proj=longlat +ellps=WGS84" is the assumed base coordinate system. FYI, in sp, there is spTransform() which can wrap the required back-projection and perform reprojections for more complicated data sets. See ?project and ?spTransform Cheers, Mike. On Tue, Mar 1, 2011 at 1:45 PM, Arnold Salvacion <[hidden email]> wrote: > Dear Colleagues, > Good day! > I have a data points collected using GPS..It was on latitude and longitude coordinate system ..I wonder if there's any function in R where I could convert those GPS data points to UTM (e.g. UTM Zone 51N)? > Thanks in advance > Arnold > > > > >        [[alternative HTML version deleted]] > > > _______________________________________________ > R-sig-Geo mailing list > [hidden email] > https://stat.ethz.ch/mailman/listinfo/r-sig-geo> > -- Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: [hidden email] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|
Report Content as Inappropriate

## Re: converting lat long points to UTM

 I just noticed that proj4 package has been updated after several years of stasis, this might be helpful if rgdal is overkill for you: library(proj4) ptransform(cbind(xy)/180*pi, "+proj=longlat +ellps=WGS84", "+proj=utm +zone=51 +ellps=WGS84")           [,1]    [,2] [,3] [1,] -48636.65 1109577    0 [2,] 213372.05 5546301    0 Note that the input coordinates are expected to be in radians - which is how PROJ.4 operates natively as I understand. The mapproj package is another old one that has been recently updated, another option that might be of use. Cheers, Mike. On Tue, Mar 1, 2011 at 2:08 PM, Arnold Salvacion <[hidden email] > wrote: >   Hi Mike, > > > Thank you very much,,will try it and let you know what happens. > > Arnold > > --- On *Tue, 3/1/11, Michael Sumner <[hidden email]>* wrote: > > > From: Michael Sumner <[hidden email]> > Subject: Re: [R-sig-Geo] converting lat long points to UTM > To: "Arnold Salvacion" <[hidden email]> > Cc: [hidden email] > Date: Tuesday, March 1, 2011, 10:54 AM > > > The rgdal package has the project() function for direct conversion > to/from longlat (WGS84) - via the PROJ.4 library, via GDAL - all > embedded in the package. > > library(rgdal) > xy <- cbind(c(118, 119), c(10, 50)) > project(xy, "+proj=utm +zone=51 ellps=WGS84") >           [,1]    [,2] > [1,] -48636.65 1109577 > [2,] 213372.05 5546301 > > Be aware that that is a very minimal "PROJ.4" string (metres is > assumed), and that "+proj=longlat +ellps=WGS84" is the assumed base > coordinate system. > > FYI, in sp, there is spTransform() which can wrap the required > back-projection and perform reprojections for more complicated data > sets. > > See ?project and ?spTransform > > Cheers, Mike. > > On Tue, Mar 1, 2011 at 1:45 PM, Arnold Salvacion > <[hidden email]> > wrote: > > Dear Colleagues, > > Good day! > > I have a data points collected using GPS..It was on latitude and > longitude coordinate system ..I wonder if there's any function in R where I > could convert those GPS data points to UTM (e.g. UTM Zone 51N)? > > Thanks in advance > > Arnold > > > > > > > > > >        [[alternative HTML version deleted]] > > > > > > _______________________________________________ > > R-sig-Geo mailing list > > [hidden email] > > https://stat.ethz.ch/mailman/listinfo/r-sig-geo> > > > > > > > -- > Michael Sumner > Institute for Marine and Antarctic Studies, University of Tasmania > Hobart, Australia > e-mail: [hidden email] > > > -- Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: [hidden email]         [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Open this post in threaded view
|
Report Content as Inappropriate

## Re: converting lat long points to UTM

 In reply to this post by Arnold Salvacion Hi Arnold If i remember right, its in the Rgdal package. You need the librariy gdal in your system, this gave me some problems on Ubuntu Linux. Then what you are looking for is something like : points <- spTransform(points, CRS = ("+proj=longlat") remember that you have to give the right proj4string to your spatialDataPoints before. Hope this is right, but otherwise i will be corrected i am sure ;) Regards Jan 2011/3/1 Arnold Salvacion <[hidden email]> > Dear Colleagues, > Good day! > I have a data points collected using GPS..It was on latitude and longitude > coordinate system ..I wonder if there's any function in R where I could > convert those GPS data points to UTM (e.g. UTM Zone 51N)? > Thanks in advance > Arnold > > > > >        [[alternative HTML version deleted]] > > > _______________________________________________ > R-sig-Geo mailing list > [hidden email] > https://stat.ethz.ch/mailman/listinfo/r-sig-geo> >         [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list [hidden email] https://stat.ethz.ch/mailman/listinfo/r-sig-geo