Skip to content

Instantly share code, notes, and snippets.

@mdsumner
Last active August 5, 2022 05:47
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 mdsumner/e7aaa823bed75beda0b2d8a11cd50368 to your computer and use it in GitHub Desktop.
Save mdsumner/e7aaa823bed75beda0b2d8a11cd50368 to your computer and use it in GitHub Desktop.

https://www.naturalearthdata.com/downloads/50m-raster-data/50m-natural-earth-2/

https://twitter.com/mdsumner/status/1555430150535188480

src <- "/vsizip//vsicurl/https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/50m/raster/NE2_50M_SR.zip/NE2_50M_SR/NE2_50M_SR.tif"

library(whatarelief)
library(ximage)

pt <- c(147, -42)
im <- imagery(source = src, extent = c(-1, 1, -1, 1) * 1e6, dimension = c(1024, 1024), 
              projection  = sprintf("+proj=laea +lon_0=%f +lat_0=%f", pt[1], pt[2]))

ximage(im, extent = c(-1, 1, -1, 1) * 1e6, asp = 1)

image

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