latlon2utm | R Documentation |
Convert longitude and latitude coordinates to Universal Transverse Mercator coordinates.
latlon2utm(lon, lat, zone = NULL, quiet = TRUE)
lon |
Numeric vector of longitudes. |
lat |
Numeric vector of latitudes, same length as |
zone |
Numeric scalar of the UTM zone, default NULL. See details. |
quiet |
Logical scalar indicating whether to refrain from printing the determined
zone when |
If zone
is NULL, then the zone is determined from the medians
of lon
and lat
.
A data frame with two columns (easting and northing) and as many rows as
the length of lon
containing the converted UTM coordinates in
meters.
Based on a function posted by Stanislav on 13 May 2015 on stackoverflow [link].
lon2utmZone
mylon <- c(-92.11, -76.47, -82.27, -83.42) mylat <- c(46.76, 44.34, 44.76, 45.41) latlon2utm(mylon, mylat, quiet=FALSE) sapply(1:length(mylon), function(i) latlon2utm(mylon[i], mylat[i], quiet=FALSE)) latlon2utm(mylon, mylat, 18)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.