lon2utmZone: Determine UTM Zone from Longitude

Description Usage Arguments Value References Examples

View source: R/lon2utmZone.R

Description

Determine the Universal Transverse Mercator zone that contains the given longitude coordinates.

Usage

1
lon2utmZone(lon, lat = NULL)

Arguments

lon

Numeric vector of longitudes.

lat

Numeric vector of latitudes, same length as lon, default NULL.

Value

A numeric vector giving the UTM zones (integers) containing the lon. If lat is not NULL, then zones are corrected to account for the special cases of Svalbard and parts of Norway.

References

Based on a function posted by Josh O'Brien on 8 Feb 2012 on stackoverflow [link]. and code for exceptions posted by wittrup on 13 Sep 2013 on stackoverflow [link].

Examples

1
2
3
4
mylon <- c(-82.27, NA, -122.44, 21.97, 21.97)
mylat <- c(44.76, 37.77, 37.77, NA, 78.64)
lon2utmZone(mylon)
lon2utmZone(mylon, mylat)

JVAdams/EchoNet2Fish documentation built on Feb. 15, 2021, 4:27 a.m.