project {rgdal}R Documentation

Projection of coordinate matrices

Description

Interface to the PROJ.4 library of projection functions for geographical position data, no datum transformation possible. Use spTransform() for extended support.

Usage

project(xy, proj, inv = FALSE)

Arguments

xy

2-column matrix of coordinates

proj

character string of projection arguments; the arguments must be entered exactly as in the PROJ.4 documentation, in particular there cannot be any white space in +<arg>=<value> strings, and successive such strings can only be separated by blanks.

inv

default FALSE, if TRUE inverse projection to geographical coordinates

Details

Full details of projection arguments available from website below, and examples in file "epsg" in the data directory installed with PROJ.4.

Value

A two column matrix with projected coordinates.

Note

The locations of Hawaii and Alaska in the data source are (putting it mildly) arbitrary, please avoid airlines using these positions.

Author(s)

Barry Rowlingson, Roger Bivand Roger.Bivand@nhh.no

References

http://proj.maptools.org/

See Also

CRS-class, spTransform-methods

Examples

data(state)
res <- project(cbind(state.center$x, state.center$y),
 "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100")
res1 <- project(res, "+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100", inv=TRUE)
summary(res1 - cbind(state.center$x, state.center$y))
plot(cbind(state.center$x, state.center$y), asp=1, type="n")
text(cbind(state.center$x, state.center$y), state.abb)
plot(res, asp=1, type="n")
text(res, state.abb)

[Package rgdal version 0.7-8 Index]