changeproj-prevR-method: Convert map projection of a object of class prevR.

Description Usage Arguments Details Value See Also Examples

Description

This function converts map projection (and/or datum) used by an object of class prevR into another one.

Usage

1
2
## S4 method for signature 'prevR'
changeproj(object, proj)

Arguments

object

object of class prevR.

proj

new map projection.

Details

proj could be a character string corresponding to a PROJ.4 projection (see https://proj.org/ for more details) or an object of class sp::CRS.

changeproj transform the columns "x" and "y" of the slot clusters of object and convert boundary using the new map projection defined by proj.
If applicable, the slot rings will be recalculated.

Value

Return object expressed in the projection proj.

See Also

rgdal::spTransform(), prevR.

Examples

1
2
3
4
5
6
7
print(fdhs)
plot(fdhs, axes=TRUE, main="Projection: longitude/latitude")

fdhs2 <- changeproj(fdhs,
                   "+proj=utm +zone=30 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
print(fdhs2)
plot(fdhs2, axes=TRUE, main="Projection: UTM Zone 30")

prevR documentation built on Aug. 28, 2020, 5:08 p.m.