I'm trying to clip a raster (GeoTIFF) with a vector layer in QGIS (version 2.18).

I get the error "ERROR 1: Attempt to create 0x0 dataset is illegal,sizes must be larger than zero." when I changed the resolution (x and y resolution = 250 meters, the same resolution of my input raster).

However, when I choose for "keep the resolution of the input raster", the program script indicates a resolution "-tr 0.002083333 0.002083333" and gives a clipped raster with only missing values ("nan").

My raster and vector polygon have the same coordinate reference system (WGS 84).

1 Answer 1


Reproject your vector and raster data into a projection that uses meter or feet units depending on your region and try the clip tool again. WGS84 can cause a problem because the pixel sizes of the raster data are in decimal degree. Using a projection of meter unit, for example UTM, can solve the problem.

  • Thank you, resampling to another projection (UTM) did indeed work.
    – user132304
    Commented Nov 21, 2018 at 19:24
  • @user132304 Glad it worked :)
    – ahmadhanb
    Commented Nov 21, 2018 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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