Open mdsumner opened 1 year ago
hmm, no it doesn't work properly - the target dim screws up the extent
the only thing that works reliably with this source is to override the original extent, and ask for specific overview dims
library(vapour)
library(ximage)
info <- vapour_raster_info("https://herbariumnsw-pds.s3-ap-southeast-2.amazonaws.com/images/NSW041500.jp2")
ovr <- matrix(info$overview, byrow = TRUE, ncol = 2)
ovr <- ovr[nrow(ovr):1, ]
im <- vapour::gdal_raster_image("vrt://https://herbariumnsw-pds.s3-ap-southeast-2.amazonaws.com/images/NSW041500.jp2?a_ullr=0,9661,7175,0",
target_dim = ovr[5,])
print(attr(im, "extent"))
ximage(im)
where 'ovr' s
we need both SRC_METHOD and DST_METHOD to be NO_GEOTRANSFORM, then we can play purely with target_dim:
even better would be the overviews, so maybe a "max_dim" argument could do