Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with opentopo source NASADEM #5

Open
mdsumner opened this issue Jun 24, 2022 · 2 comments
Open

problem with opentopo source NASADEM #5

mdsumner opened this issue Jun 24, 2022 · 2 comments

Comments

@mdsumner
Copy link
Member

mdsumner commented Jun 24, 2022

the issue is the NODATA value is-32768, but then the zeros that fill each tile override the GEBCO source

so, we might set NODATA to 0 ... it'll ruin some of the data but can always separate the sources in two calls

txt <- readr::read_file("https://opentopography.s3.sdsc.edu/raster/NASADEM/NASADEM_be.vrt")
txt <- gsub("<NODATA>-32768</NODATA>", "<NODATA>0</NODATA>", txt)
## sub out the relative paths while we're at it
txt <- gsub("relativeToVRT=\"1\">NASADEM_be", "relativeToVRT=\"0\">/vsicurl/https://opentopography.s3.sdsc.edu/raster/NASADEM/NASADEM_be", 
            txt)
  
file <- tempfile(fileext = ".vrt")
writeLines(txt, file)

library(whatarelief)
gebco <- "/vsicurl/https://public.services.aad.gov.au/datasets/science/GEBCO_2019_GEOTIFF/GEBCO_2019.tif"
nd <- file

ex <- c(147, 148, -45, -42)
e <- elevation(extent = ex, dimension = c(512, 512), threshold = 14, projection  = "OGC:CRS84")
e1 <- elevation(extent = ex, dimension = c(512, 512), threshold = 14, projection  = "OGC:CRS84", source = c(gebco, nd))

par(mfcol = c(2, 1))
ximage(e, extent = ex)
ximage(e1, extent = ex)

figure shows the tile masking in the upper figure, "fixed" in the lower figure

image

@mdsumner
Copy link
Member Author

  • replace NASADEM_be VRT url with the installed file above
  • provide more opt-out of this by having file getters 'gebco19_source()', 'NASADEM_source(opentopo = FALSE)' that elevation() uses by default
  • do that thing with the VRT where you get tile extents and build an index

@mdsumner
Copy link
Member Author

these figures show the data that missed a bit better

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant