I'm tryng to clip a raster with a shapefile using the tool in QGIS 2.18: Raster--> Extraction--> Clip.

Since I want not only to clip the raster layer, but also clip the dataset in order to have a lighter file (using the shape as a mask and checking the box "clip also the dataset" as you can see from the image [forgive me, in the image everything is in Italian]).

I tried to solve my problem with previuos discussion but nothing. In fact, the most similar was this one Rasterfile clipping error: Cannot compute bounding box of cutline, where the solution was to set the same CRS to the raster and the shape. I checked and it was the same CRS, but the error continued to appear.

If I try to clip the layer without checking the box for clipping also the dataset, it works.

Any suggestion?

enter image description here

  • This may be an overkill, but will you save your input file (OUTPUT_cum_curmap.asc) as an GeoTiff file before this clipping operation? It will be a good opportunity to ensure your CRS, too.
    – Kazuhito
    Commented Nov 1, 2018 at 11:36
  • Oh yes! (Sorry for the delay). This is also quite strange but it worked. I mean, it is strange because the layer had its CRS, and also trying to assign it again (using raster-->projection-->assign projection) it didn't work. But doing has @Kazuhito said it worked. First, thank you! Second, can you explain me why it happened?
    – Franza
    Commented Nov 9, 2018 at 9:41
  • To be honest I do not know why. There are occasions QGIS operations are influenced by data source, so I will convert KML to Shapefile and Ascii to GeoTiff whenever I encounter errors. Sorry I have no answer, but glad it worked out for you.
    – Kazuhito
    Commented Nov 9, 2018 at 10:46


Your Answer

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

Browse other questions tagged or ask your own question.