Description Usage Arguments Details Value Author(s) Examples
View source: R/convertcoords.R
Convert coordinates from one Coordinate Reference System to another
1 | convertCoords(coords, from = 4326, to)
|
coords |
a two-column matrix or data frame with easting/longitude in the first column, northing/latitude in the second column |
from |
the EPSG code for the Coordinate Reference System of the input data (default WGS84) |
to |
the EPSG code for the CRS of the output data. |
For EPSG codes, go to http://spatialreference.org/ref/epsg/ or just Google 'EPSG' with the desired CRS name.
The function requires the 'sp' and 'rgdal' packages.
A data frame or matrix with the converted coordinates.
Mike Meredith
1 2 3 | # A matrix of coordinates
x <- cbind(c(0, 1, 4, 5), c(0, 1, 3, 1))
print(convertCoords(x, to=32631)) # UTM zone 31N
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.