library(arc2r)
library(sf)
library(raster)
data("bezirke")
st_crs(bezirke)
st_crs(bezirke) <- 2056
bezirke
plot(bezirke["area_km2"], axes = TRUE)
bezirke_wgs84 <- st_transform(bezirke, 4326)

plot(bezirke_wgs84["area_km2"], axes = TRUE)
st_crs(bezirke)
bezirke_swiss <- st_transform(bezirke, 2056)

# retrieve the coordinate system
st_crs(bezirke_swiss)
# Dataset derived from the spatial interpolation of all the available "recycling points"
# in the city of Wädenwil
data("recycling_raster")

# Dataset representing the public transport quality in the city of Wädenswil
data("public_transport_waedi")# CRS -> WGS84 
# Plot the raster dataset - World Geodetic System 1984 
plot(public_transport_waedi,las=1,
     main = "Quality of public transport in the city of Wädenwil - CRS: WGS84",
     cex.main=1,font.main=4)
# Transform the coordinate system of the raster dataset publicTransport_CH
# into the Swiss Coordinate system - CH1903+LV95
publicTransport_CH = projectRaster(public_transport_waedi, recycling_raster)
# Plot the raster dataset - Swiss Coordinate System CH1903+LV95 
plot(publicTransport_CH,las=1,
     main = "Quality of public transport in the city of Wädenwil - CRS: CH1903+LV95",
     cex.main=1,font.main=4)


arc2r/book documentation built on March 5, 2021, 2:10 p.m.