2

enter image description here

I'm having issues using the "Clip Raster by Mask Layer" algorithm to clip a raster by a shapefile. When I run the algorithm, I get an error saying that the mask layer could not be loaded, even though it is already present in the legend. I've tried this after freshly opening it as well.

Though I can't go into the details about the process, I can tell you that a shapefile with the boundary of a field is used to make a 20ft inner buffer. This is then cut away from the original boundary file to make a new boundary that is 20ft smaller on every side than the original. This is then used to cut a very large raster with the Clip raster by mask layer. So it goes:

  1. Boundary (shapefile) --[SAGA:Shapes Buffer (Fixed Distance)]-> Inner Buffer
  2. Boundary + Inner Buffer --[ QGIS:Symmetrical Difference]-> SymDif (Shapefile)
  3. Raster + SymDif --[GDAL:ClipRasterByMask]-> clippedRaster

Step 3 is where I get the errors. Sometimes it just doesn't write any file (probably going to make another post about that), but in this case, it can't read the output from step 2 (SymDif file).

16
  • Are you able to confirm that the mask layer and the raster layer are both using the same CRS? Commented Jun 24, 2016 at 7:25
  • They are in the same CRS. I'm working a process that has been laid out for me, and should work. This process was used to make these files once and should make them again. I've tried every iteration of saving temp files or named ones and none make a difference. Gives the same error about not being able to find files.
    – Berkh
    Commented Jun 24, 2016 at 22:29
  • 1
    Sorry about that. I mean i'm curious why the path to your mask layer is something along the lines of "layername=8 difference or shrunk boundary" and not something that looks like <layername>.shp Commented Jun 27, 2016 at 8:11
  • 1
    Not sure about spaces in file names. I know many years ago ArcView didn't like it, not sure if its still an issue or if its an issue in QGIS. I think it is worth a try. Commented Jun 27, 2016 at 21:10
  • 1
    I'm very suspicious of the | and the = in the path for the file GDAL can't open, as per the error message. Are those things QGIS added via the GUI? maybe try the same command on the GDAL command line tool, but with a path without those special characters. Also, a good idea to not start the names of rasters with a number (throws some ArcGIS tools, if you ever use those). Commented Jun 28, 2016 at 3:38

1 Answer 1

-1

Seems like there might be an issue when you:

  • Save the output as a temporary file and
  • Check the Open output file after running algorithm option.

I would suggest saving the output as a normal file instead of a temporary one, works for me.

1
  • I've tried the same. Still getting an error with loading the input file. Is there some initializing step I'm missing? What confuses me is that these files were fresh loaded in and all references were made by QGIS.
    – Berkh
    Commented Jun 24, 2016 at 22:32

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.