I have one raster and a shapefile of points. I want to check them if they are in the same coordinate system by plotting them together on a map (like in a classical GIS), here the R script :
# raster first library(raster) setwd("P:/folder/") my.raster <- raster("raster_1991.img") # shapefile second library(rgdal) library(sp) library(maptools) setwd("P:/folder") meteo.shp <- readShapePoints("meteo.shp") # set up same coordinate system coord.sys <- CRS("+init=epsg:2065") proj4string(meteo.shp) <- coord.sys proj4string(my.raster) <- coord.sys # plot them in one map (window) plot(meteo.shp) plot(my.raster, bg = "transparent", add = TRUE)
I am able to read the data and plot them, but only separately. How can I make sure myself that the points - meteo stations - are exactly where they should be if I cannot check them on a map?