2

I am supposed to clip 6 raster files of Europe by a raster of agricultural land in Europe (mask layer). Initially, to do that I vectorised my mask layer and then clipped the rasters by that. It seemed to work fine. I then normalised my outputs to all range from 0-1.

But my professor now says that I was not supposed to do it this way, since it causes “masking issues“ when comparing the output rasters. Specifically, he criticised that my output rasters don’t make it clear which pixels are no data and which are 0 and that when using a vector to clip it might create some “odd shapes”, i.e. cutting a cell in half. I checked my outputs and couldn’t see any evidence of this, but I have to redo my files anyway.

I’ve spent several days trying to figure out how to do the clipping using a raster as the mask layer instead, but couldn’t get it to give me outputs that make sense. Some things I tried:

Grateful for any help! :)

3
  • Have you tried extracting the extent/bbox of the raster layer?
    – Erik
    Aug 26, 2022 at 10:14
  • Just gave that a try and the extent is given as much larger than what I would need to clip to, unfortunately.
    – geogalog
    Aug 26, 2022 at 10:37
  • 1
    I wonder if setting your mask layer as the "Alpha" layer would do the trick, or if that would only impact display. Could you give more details on what went wrong with the different methods you tried?
    – ChloeG
    Aug 29, 2022 at 12:24

1 Answer 1

1

Figured it out in the end by creating a new raster of the outline of my area with everything inside the area set as 1 and everything outside the outline set as NoData (set these when exporting the newly created file). Then multiplied my other rasters by this one in the raster calculator.

Your Answer

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

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