Skip to content

Commit

Permalink
re create
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Mar 28, 2024
1 parent 14340ef commit 6386ab2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions data-raw/Bathy.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
prj <- "+proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"
src <- readAll(raadtools::readtopo("gebco_14")) ##, xylim = extent(-180, 180, -90, 0))

r <- raster(projectExtent(raster(extent(-180, 180, -90, -5), crs = proj_longlat()), prj))
#src <- readAll(raadtools::readtopo("gebco_14")) ##, xylim = extent(-180, 180, -90, 0))
src <- "/vsicurl/https://gebco2023.s3.valeria.science/gebco_2023_land_cog.tif"
r <- raster(projectExtent(raster(extent(-180, 180, -90, -5), crs = "EPSG:4326"), prj))
## cleanup and rebuild
r <- raster(spex::buffer_extent(r, 16000), crs = prj)
res(r) <- 16000
Bathy <- projectRaster(src, r)
Bathy <- raster(terra::project(terra::rast(src), terra::rast(r), by_util = TRUE))

dataType(Bathy) <- "INT2S"
Bathy <- setValues(Bathy, as.integer(values(Bathy)))

Expand Down

0 comments on commit 6386ab2

Please sign in to comment.