| tm_fwd | R Documentation |
Convert geographic coordinates to/from Transverse Mercator projection with user-specified central meridian and scale factor.
Two versions are provided:
tm_fwd()/tm_rev(): Series approximation, fast, accurate to ~5 nanometers
tm_exact_fwd()/tm_exact_rev(): Exact formulation, slower but accurate everywhere
tm_fwd(x, lon0, k0 = 0.9996)
tm_rev(x, y, lon0, k0 = 0.9996)
tm_exact_fwd(x, lon0, k0 = 0.9996)
tm_exact_rev(x, y, lon0, k0 = 0.9996)
x |
For forward conversion: a two-column matrix or data frame of coordinates (longitude, latitude) in decimal degrees. For reverse conversion: numeric vector of x (easting) coordinates in meters. |
lon0 |
Central meridian in decimal degrees. Can be a vector to specify different central meridians for each point. |
k0 |
Scale factor on the central meridian. Default is 0.9996 (UTM). Common values: 0.9996 (UTM), 1.0 (many national grids), 0.9999 (some state planes). |
y |
Numeric vector of y (northing) coordinates in meters (reverse only). |
The Transverse Mercator projection is a conformal cylindrical projection commonly used for:
UTM (Universal Transverse Mercator) zones
Many national and state coordinate systems
Large-scale topographic mapping
Unlike utmups_fwd() which automatically selects UTM zones, these functions
allow you to specify any central meridian and scale factor.
The series approximation (tm_fwd/tm_rev) is accurate to ~5 nanometers
within 3900 km of the central meridian. The exact version
(tm_exact_fwd/tm_exact_rev) is slower but works accurately everywhere.
The lon0 parameter is vectorized, allowing different central meridians
for each point (useful for processing data across multiple zones).
Data frame with columns:
For forward conversion:
x: Easting in meters
y: Northing in meters
convergence: Grid convergence in degrees
scale: Scale factor at the point
lon, lat: Input coordinates (echoed)
lon0: Central meridian (echoed)
For reverse conversion:
lon: Longitude in decimal degrees
lat: Latitude in decimal degrees
convergence: Grid convergence in degrees
scale: Scale factor at the point
x, y: Input coordinates (echoed)
lon0: Central meridian (echoed)
utmups_fwd() for automatic UTM zone selection.
# Basic Transverse Mercator (like UTM zone 55)
pts <- cbind(lon = c(147, 148, 149), lat = c(-42, -43, -44))
tm_fwd(pts, lon0 = 147, k0 = 0.9996)
# Compare with UTM
utmups_fwd(pts)
# Custom scale factor (k0 = 1.0)
tm_fwd(pts, lon0 = 147, k0 = 1.0)
# Different central meridian for each point
tm_fwd(pts, lon0 = c(147, 148, 149), k0 = 0.9996)
# Round-trip conversion
fwd <- tm_fwd(pts, lon0 = 147, k0 = 0.9996)
tm_rev(fwd$x, fwd$y, lon0 = 147, k0 = 0.9996)
# Exact version for high precision or extreme locations
tm_exact_fwd(pts, lon0 = 147, k0 = 0.9996)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.