xyConv: Convert xy coordinates from one projection to another.

Description Usage Arguments Value Author(s) Examples

View source: R/xyConv.R

Description

Takes a dataframe with XY coordinates as input and converts the coordinates to another projection system. The function defaults to converting longlat to UTM zone 11, however any properly formated CRS string is acceptable for input.

Usage

1
2
xyConv(df, xy = c("long_x", "lat_y"), CRSin = "+proj=longlat",
  CRSout = "+proj=utm +zone=11", outclass = "data.frame")

Arguments

df

A dataframe that contains x, y coordinates.

xy

A vector of the names for the input x and y coordinates. Default is long_x and lat_y

CRSin

The CRS string of the input coordinates, defaults to longlat

CRSout

The CRS string of the output coordinates, defaults to UTM Zone 11

outclass

The class of the data object to be returned. Options include 'data.frame', 'data.table', and 'spdf'. 'spdf' returns an object of class sp::SpatialPointsDataFrame.

Value

the original data.table, data.frame or SpatialPointsDataFrame with converted XY coordinates added to the object.

Author(s)

Mitchell Gritts

Examples

1
df <- xyConv(dat, xy = c('geox', 'geoy'))

ndow-wisr/rNDOW documentation built on May 23, 2017, 11:36 a.m.