My Issue
According to the docs it appears that gdalwarp has many more resampling methods than gdal_translate. Can anybody explain why the resampling methods can't be used with both functions? Alternatively can you explain how to achieve the same result?
I have a big vrt that I'm trying to crop into a raster with a lower resolution covering a smaller geographic region. gdal_translate has the '-projwin' option which allows me to select smaller region without reading the entire dataset.
I see that gdalwarp has the '-te' option which would give me a similar result, except that it looks like it tries to read the entire dataset into memory prior to cropping it to the extent that I specify. (ERROR 1: Integer overflow).
I would be happy using either method as long as the result that I get comes in a somewhat performant manner for a small region.
Things I've tried
gdal_translate -r max …- GDAL_RASTERIO_RESAMPLING = max not supportedgdal_warp -te xmin ymin xmax ymax …- Integer overflow .- A combination of translate to crop the image without downsampling, then gdal_warp to downsample. While this works the two operations take too long for my use case.
Exact commands tried
gdalwarp -ts 10 10 -te -122.4396 47.5189 -122.1892 47.6830 dem.vrt test_wc.tif -overwrite --config GDAL_CACHEMAX 100 -wm 100 -multi -wo NUM_THREADS=ALL_CPUSgdalwarp -ts 10 10 -te -122.4396 47.5189 -122.1892 47.6830 dem.vrt test_wc.tif -overwrite --config GDAL_CACHEMAX 100 -wm 100 -multi -wo NUM_THREADS=ALL_CPUS
What can I do to use the max resampling method, while cropping a large dataset?
Gdal Info
Driver: VRT/Virtual Raster
Files: dem.vrt
LongFileList…
Size is 1296003, 421203
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-180.000416666666666,61.000416666666666)
Pixel Size = (0.000277777777778,-0.000277777777778)
Corner Coordinates:
Upper Left (-180.0004167, 61.0004167) (180d 0' 1.50"W, 61d 0' 1.50"N)
Lower Left (-180.0004167, -56.0004167) (180d 0' 1.50"W, 56d 0' 1.50"S)
Upper Right ( 180.0004167, 61.0004167) (180d 0' 1.50"E, 61d 0' 1.50"N)
Lower Right ( 180.0004167, -56.0004167) (180d 0' 1.50"E, 56d 0' 1.50"S)
Center ( -0.0000000, 2.5000000) ( 0d 0' 0.00"W, 2d30' 0.00"N)
Band 1 Block=128x128 Type=Float32, ColorInterp=Gray
NoData Value=-9999999