convUL {PBSmapping}R Documentation

Convert Coordinates between UTM and Lon/Lat

Description

Converts coordinates between UTM and Lon/Lat.

Usage

convUL (xydata)

Arguments

xydata data frame with columns X and Y.

Details

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 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 + 6i < x <= -180 + 6i degrees.

This function converts the X and Y columns of xydata from "LL" to "UTM" or vice-versa. After the conversion, it adjusts the data frame's attributes accordingly.

Value

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.

See Also

closePolys, fixBound.

Examples

#--- load the data (if using R)
if (!is.null(version$language) && (version$language == "R"))
  data(nepacLL)
#--- set the zone attribute
attr(nepacLL, "zone") <- 9
#--- convert and plot the result
nepacUTM <- convUL(nepacLL)
plotMap(nepacUTM)

[Package PBSmapping version 2.09 Index]