Created
May 8, 2022 21:29
-
-
Save h-a-graham/72aba85c4b30627071f05e8826d66edd to your computer and use it in GitHub Desktop.
An example of how to directly warp a geoid model into R.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Warp and plot the EGM2008 1' geoid model | |
# geoid COGS hosted here: https://www.agisoft.com/downloads/geoids/ | |
library(vapour) | |
library(gdalio) | |
library(terra) | |
source(system.file("raster_format/raster_format.codeR", package = "gdalio", mustWork = TRUE)) | |
geoid <- '/vsicurl/https://s3-eu-west-1.amazonaws.com/download.agisoft.com/gtg/us_nga_egm2008_1.tif' | |
ri <- vapour_raster_info(geoid) | |
gdalio_set_default_grid(extent=ri$extent, | |
dimension = ri$dimXY, | |
projection = ri$projection) | |
geoid_ras <- gdalio_terra(geoid) | |
plot(geoid_ras, col=scico::scico(255), axes=FALSE) |
Author
h-a-graham
commented
May 8, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment