Clip a Raster Layer in QGIS (three different ways)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to open source options and another qgis tutorial in this tutorial i'm going to show you the easiest way to clip a raster in qgis now if you watched the last video we went over how to merge rasters together and this is kind of the opposite instead of combining rashes we want to take apart out of a raster and make that its own separate file now let's go ahead and i'll show you kind of an example of what i mean so here i have this merged raster file if i turn this off you can see that now i have just one part of that raster over here instead of the whole thing there's going to be times where you want to clip out a certain area because if you're working analysis on an entire raster it can take a lot of processing resources but if you cut that down it can be easier to deal with and it may also represent your study area better so let's go over how we can clip a raster so for this example i'm going to be use clip raster by extent and i'm going to grab that from the raster toolbar we're going to go to extraction we want to go clip raster by extent now with clip raster by mask layer we can clip it to a polygon we can cover that in a future tutorial but if we do it by extent it we can do with any raster without loading any more data and we can still specify things pretty exactly so let's click click raster by extent and this is going to give us a a rectangular extent and if i come over here i can calculate the extent from a layer i can use the map canvas extent or i can draw on the canvas and let's just go through all of these actually so if i want to calculate from layer i can click in one of these layers here it gives me an extent and the associated crs that goes with it i'm going to save this to a temporary file and let's click run okay and there it's done let's close that out let's turn off the merged layer you can see that it clipped it to the same extent as that raster layer there both i turned that one on same extent turn that one on same extent okay let's try this again let's go into raster let's go back to extraction let's go clip by extent again and now let's say i want to have a custom extent there's two ways to do this first we can use the map canvas extent let's go ahead and do that so if i zoom in and i say okay this area right here is the area i want i'm going to zoom right in on that now i can go in i can go to raster extraction clip by extent come down here and select use map canvas extent and i'm going to go ahead and click run i'm going to close that out and that one actually didn't work when we did it let's zoom out we didn't get the data in there but you can see it did clip it to the extent it just did not do a very good job of saving the data and i'm not sure why that is but you can see that the extent matched where we clipped it to okay that could be a problem with my raster layer now let's go ahead and try to draw for this next one so let's go into uh raster and extraction clip by extent and let's come down and click draw on canvas and i'm going to draw oh let me cancel that let me draw on the canvas again i didn't just drag and i just clicked once let's draw on canvas so if i click and drag you can see that a transparent square or rectangle covers the area and i'm going to get this area right here and i'm going to go ahead and click run now let's go ahead oh and i see what the problem is i know why it didn't work last time i didn't change the layers i got to change this back to merged my apologies for the mistake there and now let's click run close and now you can see that we've clipped out that part of merge right there that we were that we had dragged over okay so we can turn that off now i'm going to get rid of this one i will redo this so i can show you what it looks like using the correct layer and i apologize i did not catch that earlier and so let's go ahead and turn merged back on and let's zoom in to we'll zoom into the upper right corner up here so that we can uh know that it's different and if we go over to raster and we go to extraction clip by extent and now we come down and we choose this by use the map canvas extent and we click run now we can close that open i think it did the exact same thing i did last time guys sorry let's just try that one more time raster extraction by extent change this to merged and now specify that we calculate from the map extent and now click run close and now you can see that we have that raster for that upper corner and we have our separate rasters i'm going to go ahead and remove this one that i messed up twice in a row and now you can see that we have our separate rasters here that we've done differently for each of those so that's how you could easily and quickly or subset a raster and clip a raster in qgis using extents now you notice that all these are rectangular um and if you want to get something that's like the shape of a watershed to the shape of a polygon you need to use the the clip to a masked area and we'll cover that in a future video so thanks for watching guys i hope you've enjoyed this video and as always you can check out open source options hoping to have a tutorial up on this in the website with step by step instructions that you can follow along
Info
Channel: Geospatial School
Views: 53,554
Rating: undefined out of 5
Keywords: open source, open source options, open source software, qgis, qgis clip, qgis clip raster, qgis raster extent, raster gis, raster extent, easy clip raster, extract raster, clip by mask, raster analysis, arcgis clip, arcgis
Id: hPSIW1W3XjY
Channel Id: undefined
Length: 6min 16sec (376 seconds)
Published: Tue Mar 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.