We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
we need both SRC_METHOD and DST_METHOD to be NO_GEOTRANSFORM, then we can play purely with target_dim:
im <- vapour::gdal_raster_image("https://herbariumnsw-pds.s3-ap-southeast-2.amazonaws.com/images/NSW041500.jp2", target_dim = c(0, 1024), options = c("-to", "SRC_METHOD=NO_GEOTRANSFORM", "-to", "DST_METHOD=NO_GEOTRANSFORM")) ximage(im)
even better would be the overviews, so maybe a "max_dim" argument could do
info <- vapour::vapour_raster_info("https://herbariumnsw-pds.s3-ap-southeast-2.amazonaws.com/images/NSW041500.jp2") ovr <- matrix(info$overview, byrow = TRUE, ncol = 2) max_dim <- 1024 if (!is.null(ovr)) { idx <- max(c(findInterval(max_dim, rev(ovr[,1])), findInterval(max_dim, rev(ovr[,2]))) ) dimension <- ovr[nrow(ovr):1, ][idx, ] }
The text was updated successfully, but these errors were encountered:
hmm, no it doesn't work properly - the target dim screws up the extent
Sorry, something went wrong.
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
No branches or pull requests
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
The text was updated successfully, but these errors were encountered: