convUL | R Documentation |
Convert coordinates between UTM and Lon/Lat.
convUL (xydata, km=TRUE, southern=NULL)
xydata |
|
km |
|
southern |
|
The object xydata
must possess a projection
attribute that
identifies the current projection. If the data frame contains UTM
coordinates, it must also have a zone
attribute equal to a
number between 1 and 60 (inclusive). If it contains
geographic (longitude/latitude) coordinates and the zone
attribute is
missing, the function computes the mean longitude and uses that value
to determine the zone. The longitude range of zone i
is
-186 + 6 i^\circ < x \le -180 + 6 i^\circ
.
This function converts the X
and Y
columns of
xydata
from "LL"
to "UTM"
or vice-versa. If the
data span more than one zone to the right or left of the intended
central zone, the underlying algorithm may produce erroneous
results. This limitation means that the user should use
the most central zone of the mapped region, or allow the function to determine
the central zone when converting from geographic to UTM coordinates.
After the conversion, this routine adjusts the data frame's attributes accordingly.
A data frame identical to xydata
, except that the X
and
Y
columns contain the results of the conversion, and the
projection
attribute matches the new projection.
Nicholas M. Boers, Software Engineer, Jobber, Edmonton AB
Maintainer: Rowan Haigh, Program Head – Offshore Rockfish
Pacific Biological Station (PBS), Fisheries & Oceans Canada (DFO), Nanaimo BC
locus opus: Regional Headquarters, Vancouver BC
Last modified Rd: 2022-09-06
Ordnance Survey. (2020) A guide to coordinate systems in Great Britain. Copyright Ordnance Survey 2018 (v3.6). Southampton, UK.
closePolys
,
fixBound
.
local(envir=.PBSmapEnv,expr={
oldpar = par(no.readonly=TRUE)
#--- load the data
data(nepacLL,envir=.PBSmapEnv)
#--- set the zone attribute
#--- use a zone that is most central to the mapped region
attr(nepacLL, "zone") <- 6
#--- convert and plot the result
nepacUTM <- convUL(nepacLL)
plotMap(nepacUTM)
par(oldpar)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.