# Single point forward conversion
result <- utmups_fwd(c(147.325, -42.881))
result
# Multiple points
pts <- cbind(lon = c(147, 148, -100, 0),
lat = c(-42, -43, -42, 0))
utmups_fwd(pts)
# Reverse conversion
utmups_rev(result$x, result$y, result$zone, result$northp)
# Round-trip conversion
fwd <- utmups_fwd(pts)
rev <- utmups_rev(fwd$x, fwd$y, fwd$zone, fwd$northp)
cbind(original = pts, converted = rev[, c("lon", "lat")])
# Polar regions use UPS (zone 0)
polar <- cbind(c(147, 148, -100), c(88, -88, -85))
utmups_fwd(polar)
Run the code above in your browser using DataLab