Batch Processing in QGIS # Lesson 27 of 29 # QGIS Tutorial.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Music] hi welcome to this qgis tutorial lesson 27 in this video we will learn how to do a simple byte processing in qgis if you haven't subscribed to my channel please do so so that you can get a notification when i upload my next video if you're new to my channel you can follow all my previous videos and useful years tips from the links in descriptions below let's get started so what is bad processing batch processing is a method of running high volume repetitive data jobs the batch method allows users to process data when computing resources are available and with little or no user interface so let's go to qgis and look at today's exercise i'm going to load some vector layers in qgis so i'm going to go to the layer add layer add vector layer and i'm going to browse for where my data is and i'm going to add african data so i'm going to go to gis folder data i have actually downloaded this data from a site i'm going to project provide a link in the description below so africa then i'm going to first load the african country share files i'm going to just customize here to srshap file then now we are going to go and select africa then open then add so i've actually added the african ship file the next thing i'm going to do is i'm going to add also another layer here which is a line layer and i'm going to add the africa major rods then i'm going to click on close and those two layers are going to help us today in our exercise so i have the african layer which is a polygon and i have the major rods which is a line so what what i want to do next is i want to you can actually see the layer of the road is just one layer and it covers the whole of africa but my interest is i want to have the roles of each and every country separately so what i can do is i can run a simple task called clipping but that means i'm going to clip data for every region although now we have an option in qgi as whereby you can actually just clip them once without actually necessarily clipping one by one by one by one so what we're going to do is we're going to learn how to use this but process the first thing i'm going to do is you can see african continent also it is just having is just in one shapefile that has actually opened there should be table you will see that it just has continuous data of all the african countries marked together so the first thing i want to do is i want us to split these layers this layer so that each and every country has its own shape file so how do i do that so the first thing i'm going to do is i'm going to go to vector and i'm going to go to data management tools and then i'm going to scroll down to split vector layer because i want to split all these vector left i'm going to select split effect layers then the input layer is africa then the unique id that i'm going to split using is the name of the african country so it's actually the name column then the next thing i'm going to do is i'm going to look at the output so for the output i'm going to leave it as your package you can actually save it into any other file format that you want like share file or the dba file or the json file but i'm just going to leave it to your package and the output directory i'm going to save it to a directory i'm going to create actually a directory where i'm going to save now the split layer so i'm going to create a new folder here in the africa folder and i'm going to call it africa split so i'm going to save all these into this directory called africa split select folder then i'm going to run the process i'm going to click on run and you can see it's running the process here and it's saving everything here so let's give it some time to finish this process the logarithm has finished so let's go and try to load these layers and see if it is actually split so i'm going to go to layer add layer add vector layer and remember that your package layers are going to browse for them and you can see there is under the african split and you can see this algeria angola beneath so i'm just going to load the three of them first to see if it actually worked click on add and i'm going to click on close and you can see now they have actually been loaded you can actually see if i uncheck the african country i have now some of the split layers i mean i'm not going to actually load all of them then i just loaded a few of them so we are good to go now to the next step i'm going to remove them but i really remember the africa and the major roads the major roads are actually taking a lot of time loading because you can actually see there are very very many roads so it takes quite a while to just load all of them at once so that's why we're going to split them into the different countries so the next thing you want to do is you want to clip these rods according to the regions that you've just created where we splitted the layer so that each and every country here has its own sets of roads so the next thing i'm going to do is i'm going to go to add your processing function called clipping so i'm going to go to vector then i'm going to go to the processing tool then i'm going to select clip in our initial exercise we're actually just using the parameter input here up here and actually creating uh a clip from just the layers that are here but now we have so many layers and we want to run the process just once so what i'm going to do is we're going to run it as a batch process so on this dialog box here on you will see this somewhere down on the bottom left return run as batch process so i'm going to select run as batch process then now there is a new uh pop-up that appears so the pop-up has the input layer the overlay layer and then clipped which is the result so we need to do a lot of auto filling here so the first thing we we need to do is we need to put our input layer our input layer in this case is uh the major roads for all of africa so by default i'm going to actually select the major roads then in the overlay layer here there is just uh below the overlay there is something called autofill so you're going to select this uh small arrow here and then we're going to add the files actually so many options here so we're going to add all files from a directory the directory that created so i'm going to click on add all files from a directory then you're going to look for the directory you remember where you put all the geopackage layers so we're going to select there africa splits then select folder and then it will take a little bit of time just thinking about what you have put input there and it's populating it will actually populate all all those layers in and you can actually see there is the algeria starting in angola then benin so it will actually just pull all the uh data that was in that folder here and you can see the input layer now has been autofilled here actually the whole of the input layer is now the major roads now let's go to the next stage which is the which is the clipped so for this one i'm going to just input the first one i'm going to click on three dots here and then i'm going to create a folder here called clipped rods i already have a folder here called clip rods so i'm going to select that folder open then within the eclipse i'm going to save each and every file starting with the prefix clipped so clips then underscore then it will have maybe like for example if it's algeria it will have clipped underscore algeria clipped and that's called so different countries will have different uh parameters here so i'm going to click on save and i'm going to save them as your package layers again and then the outer field settings are here it actually pops up so the autofill mod do not uh by default it's the daughter of autofill but i'm going to select the drop down here and then i'm going to say you can actually fill it with numbers like number one two three four up to whatever number of layers you have but i'm going to fill it with parameter values what i mean with parameter values is these are the parameter values like algerian name underscore algerian minus guangola so these will be the parameter values that will actually appear then what parameter i'm going to am i going to use i'm going to use this parameter here there overlay layer you can actually look here by default it's the input layer but i'm going to select the overlay layer then i'm going to click on okay so i'm going to fill with parameter values then i'm going to select the overlay layer as the parameter that i'm going to fill it with then i'm going to click on ok and you will see now it has now out of field everything the way you want it so my result will be clipped underscore name underscore algeria at your package clipped underscore name underscore angular suite has just adopted the these parameter values from these and that is what actually makes it very very useful so i'm actually going to just run this process once so you can actually decide to check load layers on completion but actually that will take a lot of time so i'm just going to run then after that i load the layers once they have been they have been clipped so i'm going to click on run and this will take some little bit of time so i'm just going to grab a quick coffee and come back when it's done the algorithm is almost complete so let's wait for it to complete and then we can now go to the next step which is to look at our result the algorithm is complete so let's look at our final results i'm going to click on close here then i'm now going to uncheck the major roads because now we have already clipped all the all the layers so we want to just load the different layers that are now available so i'm going to go to layer add layer add vector layer then i'm going to search for now our clipped files which are in the data africa clip roles and you can see all now the clipped roads are here with the with the with the names so i can just decide to say maybe a select benning rod open add close and now you can see it has been loaded within benin i can add another layer so i got layer add layer add vector layer and browse and add another layer like maybe say uh let's go down maybe say ethiopia rose pen add close and then i zoom out and then now i have all the roads of ethiopia clipped in ethiopia so i've actually run the clipping process once by using the batch processing algorithm which is very very important in qgis that's it for today's exercise if you found this video useful and you want to learn more in qgis subscribe to my channel don't forget to give this video a thumbs up otherwise i'm just happy you're here see you in my next lesson [Music]
Info
Channel: WiseGIS
Views: 705
Rating: undefined out of 5
Keywords: batch processing in qgis, batch processing, qgis, qgis tutorial, gis
Id: X_VhOv59s18
Channel Id: undefined
Length: 13min 56sec (836 seconds)
Published: Thu Dec 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.