I am a complete noob at using GIS in R and have been trying many packages and functions but get stuck each time. What I want is to generate an elevation map for a location in the Himalayas with additional geographic points that are labeled, and possibly rivers.
What I have so far is the following code that retrieves elevation data and does some basic plotting:
library(elevatr) library(raster) #set projection prj4<-"+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" # set plot bounds bounds <- data.frame(x=c(85.8,87.4),y=c(26.6,28.2)) # retrieve elevation raster elev<-get_elev_raster(locations = bounds, prj = prj4, z=9, clip="locations") plot(elev) # Add two dots dotcoords<-data.frame(x = c(86.3,87.1), y = c(27.2,27.8)) rownames(dotcoords)<-c("locA","locB") coordinates(dotcoords) <- c("x","y") proj4string(dotcoords) <- CRS("+proj=longlat +datum=WGS84") pts_dotcoords <- spTransform(dotcoords, CRS(prj4)) plot(pts_dotcoords, add=T, pch=16)
This is probably basic stuff but I really need some advice on what approach to take to get me going in the right direction (would it be better to use ggplot2 or ggmap, for example?).