Skip to content

Instantly share code, notes, and snippets.

@a-r-d
Last active April 10, 2018 17:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-r-d/42314a458c9890339f547851b33efbf5 to your computer and use it in GitHub Desktop.
Save a-r-d/42314a458c9890339f547851b33efbf5 to your computer and use it in GitHub Desktop.
playing with elevatr public AWS data not authed
library(rgdal)
library(elevatr)
# this is the prjection system given as example in the documentation
ll_prj <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
# Im using this projection system based on reading this document:
# https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/OverviewCoordinateReferenceSystems.pdf
us_prj = "+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0"
# SpatialPoints is from 'rgdal' package
# this is centered on minneapolis
mans_sp <- SpatialPoints(coordinates(data.frame(y=-93.289865, x=44.965937)), CRS(us_prj))
# get raster data, Z is the zoom level
elevation <- get_elev_raster(mans_sp, z = 12, src = "aws")
# plot the raster data
plot(elevation)
@a-r-d
Copy link
Author

a-r-d commented Apr 10, 2018

screen shot 2018-04-10 at 12 35 58 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment