Skip to content
Prev 13801 / 29559 Next

LatLong to UTM zone and coordinates?

On Sun, 1 Jan 2012, Albin Blaschka wrote:

            
Thanks! This gives the zones, and for look-up, you could do:

library(maptools)
brdrs <- seq(-180, 180, 6)
longitude <- seq(-180,180)
# or your data
cbind(longitude, findInterval(longitude, brdrs, all.inside=TRUE))

looking like:

data(wrld_simpl)
plot(wrld_simpl)
abline(v=brdrs)
text(x=brdrs[-1]-3, 0, labels=1:60, col="red")

So the zone would be the output of:

findInterval(<yourLongitudes>, brdrs, all.inside=TRUE)

Roger