dsn <- "/vsicurl/https://projects.pawsey.org.au/idea-gebco-tif/GEBCO_2024.tif"
library(terra)
r <- rast(ext(-1, 1, -1, 1) * 6378137 * 1.9, res = 25000, crs = "+proj=spilhaus")
geb <- project(rast(dsn), r, by_util = TRUE)
cst <- as.contour(geb, levels = 0)
xy <- terra::project(xyFromCell(geb, 1:ncell(geb)), to = "EPSG:4326", from = crs(geb))
lon <- setValues(geb, xy[,1])
lat <- setValues(geb, xy[,2])
plot(geb)
plot(cst, add = TRUE)
lon2 <- lon
lon[abs(lon) > 170] <- NA
contour(lon, add = TRUE, levels = seq(-170, 170, by = 15), lty = 2)
lon2[lon2 < 0] <- lon2[lon2 < 0] + 360
contour(lon2, levels = 180, add = T, lty = 2)
contour(lat, add = TRUE, levels = seq(-80, 80, by = 20), lty = 2)
Last active
February 18, 2025 22:18
-
-
Save mdsumner/29238a990bba847b9987891575086679 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Damn that is pretty.
spil_map package?