# How to change spatial resolution using gdalwarp?

I just realized that I have Geo-TIFF's in the same coordinate system but different spatial resolution. DOP20 (20cm=1px) and DOP10 (10cm=1px) mix. Now wanted to use gdalwarp to transform the DOP20 TIFF into DOP 10. The commandline should be simple

gdalwarp.exe -tr 20000 20000 -r bilinear in.tiff out.tiff

but gdalwarp complains:

Creating outputfile that is 0Px0L Error 1 Attempt to create 0x0 dataset…

I thought it is a simple graphics operation, "blowing" a 10000x10000 pixel TIFF into a 20000x20000 pixel TIFF.

Can anybody help me understand what's wrong here?

You don't say what your coordinate system is, but if it's in meters, your-trarguments should be-tr 0.1 0.1.-trsets the resolution (m), not the image size (cols/rows.)

Just guessing but GDAL is probably complaining because you're trying to create an image that occupies less than 1 cell.

If your source dataset has a size of 10000x10000 Pixels, the command line should be

gdalwarp.exe -ts 20000 20000 -r bilinear in.tiff out.tiff

or

gdal_translate -outsize 20000 20000 -r bilinear in.tiff out.tiff