Skip to content

Instantly share code, notes, and snippets.

@mdsumner
Last active September 14, 2019 22:09
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/012c4c8e36ffa42e9053621420924eab to your computer and use it in GitHub Desktop.
Save mdsumner/012c4c8e36ffa42e9053621420924eab to your computer and use it in GitHub Desktop.
Illustration of R-Sig-geo question - Sinusoidal raster

From https://stat.ethz.ch/pipermail/r-sig-geo/2019-September/027645.html

  library(raster)
#> Loading required package: sp
ex <- extent(-11119505, -10007555, 5559753, 6671703)
prj <- "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181
+ +b=6371007.181 +units=m +no_defs"
m <- maps::map(plot = F)
d <- cbind(m$x, m$y)
plot(rgdal::project(d, prj), pch = ".")
plot(ex, add = T)  ## just a small part of the chain

## now add the actual -180 extent, the red line is the extent of the valid bounds
## of the Sinusoidal projection, but the raster necessarily falls outside for part
lines(rgdal::project(cbind(-180, 
      seq(90, 0, length = 36)), prj), col = "firebrick")

Created on 2019-09-14 by the reprex package (v0.3.0)

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