9

I want to clip a raster using a polygon I made. However, I get the following error message.

enter image description here

I've tried all the possible options but somehow I'm not being able to clip it.

QGIS 2.16.2 on Windows 10

1
  • Don't forget to save the edits to your shapefile before you clip.
    – rapbash
    Commented Apr 30, 2018 at 21:59

6 Answers 6

14

I got the same error message although the projections were the same. In my case the error came because I tried to do the clipping with a layer that was still in editing mode, i.e. the clipping polygon was not saved to disk yet. After ending editing mode and saving the layer to disk it worked.

1
  • You saved my brain.
    – srodriguex
    Commented Jul 11, 2020 at 13:06
5

I noticed that you didn't define the path of the output raster image. It is just written "myClip".

Also, make sure that both clipping (cutline) polygon and raster image have the same projection. If cutline and raster data have different projections, it will not produce the desired output of cropping the image to the extent of the polygon.

2

It happened to me too, got the same error. In my case the problem was that I tried clipping while the mask shape layer was still in edit mode and the layer edits were not saved (even though the mask layer appeared correctly in the "Clip Raster by Mask Layer" parameters window). Once I saved the layer edits and exited edit mode, mask clipping was successful with no errors.

1

I also had the same error while trying to run the clip algorithm as a batch process.

In my case, the problem was that my vector (mask) layer was a memory (virtual/temporary) layer. I exported the layer and saved permanently to disk and the algorithm went well.

0

For me the problem was in the attribute table. I opened the attribute table and there were three features. After deleting two, it worked.

-2

Problem solved.

ahmadhanb was correct. I needed to make sure the polygon and the raster image were in the same projection. Right clicking each layer and modifying the projection took care of it.

Many thanks.

0

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