I have a large raster GeoTIFF of the whole world with a low resolution, and also parts of the world with higher resolutions. Some very high, some medium high resolution.

Now I would like to create new GeoTIFFs in - let's say 1 degree increments - of the whole world. Those tiles should then have the best resolution available for that specific region. So for example:

I have the whole world in let's say 100m resolution, Europe in 50m resolution and Germany in 20m resolution.

Now I want to have a 1°x1° tile somewhere in the US. The resulting tile should be 100m resolution. But a tile from somewhere in France should be at 50m resolution. And the tile from somewhere in Germany should be at 20m resolution.

I don't know how to archive that with GDAL.

What I have so far is one VRT of all my input files that was made using gdalbuildvrt -resolution highest all.vrt all_my_input_files.tif

When I now go and gdal_translate -projwin_srs epsg:4326 -projwin 11.0 43.0 12.0 42.0 all.vrt tiled_11-42.vrt it will be in the resolution of the BEST resolution inside my vrt file. Which most likely is cause i told the vrt to be in the highest resolution. Also from areas in e.g. the US, where the best resolution there would be 100m.

How can I make it so that it chooses the highest resolution INSIDE my projwin? Is that somehow possible using GDAL?

1 Answer 1


From the gdalbuildvrt manual:

If there is some amount of spatial overlapping between files, the order of files appearing in the list of source matter: files that are listed at the end are the ones from which the content will be fetched. Note that nodata will be taken into account to potentially fetch data from less priority datasets, but currently, alpha channel is not taken into account to do alpha compositing (so a source with alpha=0 appearing on top of another source will override is content). This might be changed in later versions.

So pay attention to the order in which your files are processed. If you write carefully the shell glob, you can make sure that all the higher resolution images come after all the lower resolution ones.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.